[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  GetTriggerInfo Issue

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: GetTriggerInfo Issue
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Candido   USA  (78 posts)  [Biography] bio
Date Sun 15 May 2011 10:27 PM (UTC)  quote  ]
Message
Awesome. Thanks!
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sun 15 May 2011 10:17 PM (UTC)  quote  ]
Message
Twisol is quite right. The time was saved but not the number of match attempts. Fixed in version 4.74.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Sun 15 May 2011 09:06 PM (UTC)  quote  ]

Amended on Sun 15 May 2011 09:07 PM (UTC) by Twisol

Message
I think I know exactly what you're talking about. When you have "Expand variables" checked, the trigger's regexp is recompiled and its total execution time is copied over. [1] The trigger itself contains the count of successful matches [2], while the regexp object contains the count of attempts [3]. What's happening is that the count of attempts isn't being copied over to the newly-compiled regexp, and the count of successful matches remains because it's in the trigger, not the regexp.


[1]: https://github.com/nickgammon/mushclient/blob/master/evaluate.cpp#L355-387
[2]: https://github.com/nickgammon/mushclient/blob/master/OtherTypes.h#L566
[3]: https://github.com/nickgammon/mushclient/blob/master/regexp.h#L51

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Candido   USA  (78 posts)  [Biography] bio
Date Sun 15 May 2011 08:22 PM (UTC)  quote  ]
Message
Hello. I'm currently trying to optimize my Mushclient worlds by cracking down on the most time intensive triggers. I wrote a simple script to go through GetTriggerList() and divide GetTriggerInfo(x, 37), which is total time taken to match, by GetTriggerInfo(x, 38), the total number of attempts to match. This would give me the average time each trigger takes on each attempt, and I can just compare to find the worst.

However I started noticing some strange behavior, which is either a bug in Mushclient or a misunderstanding on my part. The triggers that floated to the top of my list claimed to have only attempted to match one time, yet their number of successful matches (trigger info 21) is higher than one. On any normal trigger this is impossible because an increment to 21 will also result in an increment to 38.

Luckily, it was easy to see what these 'one match' triggers had in common, which is that they all had expand variables checked and matched a variable in their regex, like @target.

What do you think?
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


1,073 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]