 |
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Sat Nov 17, 2007 4:10 pm
[2.12] Matching %q{@variable}%q when @variable is empty causes slowdown |
I'm not sure if this is something to be fixed or not hence why I've put it in beta (I suspect not).
I have a whoList class. A list from the mud tells who is online, one line at a time. I populate a variable, whoNew, with this information.
I compare @whoNew with @whoList which tells me if anyone has joined or left the game, then I copy @whoNew to @whoList, empty @whoNew and wait for the next list.
I had a trigger that highlights names of people online with pattern %q{@whoList}%q
Sometimes, either before I get the first list, or for whatever other reason, whoList might be empty. When the list is empty then %q{@whoList}%q matches every newline and whitespace the mud throws at me, which slows things down (Ctrl-Q drops from 11ms to 30ms)
I've worked around it fairly easily by never blanking whoList, instead putting a dummy 'x' value in which then gets removed before the whoList comparisons, but I wondered if there was anything clever that could/should be done if people match %q@var when @var could become empty, causing the trigger to match nearly everything... |
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Sat Nov 17, 2007 6:29 pm |
You might want to look at the resulting Regular Expression that is created. See what it is using when the list is empty and then see if there is anything in the reg ex that might fix it. I can certainly convert the trigger to a different regular expression, but once we have a RegEx, I don't have any control over the actual regex engine...it's all the PerlRE library.
|
|
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|