*I dont of course know how the wildmatching is done exactly, and if my examples are close or miles off, but they show how a complexe filter with many *'s might be slow because before its validated or not there are 1000's of comparasions to have to check. And this is where i said using the & (1 word) matcher would be much quicker, this of course requieres the tokenseperators to be space however.
I dont know either, but it
may be due to a performance wasting code method, and that's why I reported this, because if that is the case, some thinking and recoding may resolve this issue.
Today I fixed a performance problem, and the cause was again this.
I had an alias:
alias SC_NetQueue_CountIdentDBusy {
SC_dl SC_NetQueue_CountIdentDBusy $1-
filter -wk @SC_NetQueue return $SC_makewm(18,18 IDENTDBUSY) | return $filtered
}
(that $SC_makewm() produces here a wildcard string *×*×*×*×*×*×*×*×*×*×*×*×*×*×*×*×*×IDENTDBUSY)
This is the output, notice the timestamps:
20070527-102843 (Beavis) NETQUEUE: (GameSurge) Added task CONNECT - Server gigenet.il.us.gamesurge.net port 6667 (if enabled: delay 0 sec.)
20070527-102843 (Beavis) NETQUEUE: (UnderNet) Added task CONNECT - Server oslo1.no.eu.undernet.org port 6664 (if enabled: delay 0 sec.)
20070527-102844 (Beavis) NETQUEUE: (Abjects) Added task CONNECT - Server wolfpac.ca.us.abjects.net port 6667 (if enabled: delay 0 sec.)
20070527-102845 (Beavis) NETQUEUE: (DalNet) Added task CONNECT - Server soho.ix.us.dal.net port 6667 (if enabled: delay 0 sec.)
20070527-102847 (Beavis) NETQUEUE: (EFNet) Added task CONNECT - Server irc.igs.ca port 6666 (if enabled: delay 0 sec.)
20070527-102849 (Beavis) NETQUEUE: (Rizon) Added task CONNECT - Server irc.xstaticsolutions.com port 6667 (if enabled: delay 0 sec.)
20070527-102851 (Beavis) NETQUEUE: (IRCHighWay) Added task CONNECT - Server hiroes.de.eu.irchighway.net port 6667 (if enabled: delay 0 sec.)
20070527-102854 (Beavis) NETQUEUE: (SPEpisodes) Added task CONNECT - Server irc.spepisodes.com port 6667 (if enabled: delay 0 sec.)
20070527-102857 (Beavis) NETQUEUE: (SwiftIRC) Added task CONNECT - Server griffin.mo.us.swiftirc.net port 7000 (if enabled: delay 0 sec.)
20070527-102900 (Beavis) NETQUEUE: (freenode) Added task CONNECT - Server sterling.freenode.net port 6667 (if enabled: delay 0 sec.)
20070527-102904 (Beavis) NETQUEUE: (bunker7) Added task CONNECT - Server dethfyre.bunker7.net port 6667 (if enabled: delay 0 sec.)
20070527-102909 (Beavis) NETQUEUE: (ChatSpike) Added task CONNECT - Server stitch.chatspike.net port 6667 (if enabled: delay 0 sec.)
20070527-102913 (Beavis) NETQUEUE: (IRC3K) Added task CONNECT - Server sonic.irc3k.net port 6667 (if enabled: delay 0 sec.)
20070527-102918 (Beavis) NETQUEUE: (AustNet) Added task CONNECT - Server restored.il.us.austnet.org port 6667 (if enabled: delay 0 sec.)
20070527-102924 (Beavis) NETQUEUE: (Azzurra) Added task CONNECT - Server wmgitalia.azzurra.org port 6665 (if enabled: delay 0 sec.)
I changed above alias to:
alias SC_NetQueue_CountIdentDBusy {
SC_dl SC_NetQueue_CountIdentDBusy $1-
filter -wk @SC_NetQueue return *IDENTDBUSY) | return $filtered
}
and the output was:
20070527-105609 (Beavis) NETQUEUE: (SwiftIRC) Added task CONNECT - Server griffin.mo.us.swiftirc.net port 7000 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (Azzurra) Added task CONNECT - Server wmgitalia.azzurra.org port 6666 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (IRC3K) Added task CONNECT - Server sonic.irc3k.net port 6667 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (Rizon) Added task CONNECT - Server irc.xstaticsolutions.com port 6667 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (AustNet) Added task CONNECT - Server restored.il.us.austnet.org port 6667 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (EFNet) Added task CONNECT - Server irc.igs.ca port 6666 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (bunker7) Added task CONNECT - Server dethfyre.bunker7.net port 6667 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (UnderNet) Added task CONNECT - Server oslo1.no.eu.undernet.org port 6664 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (freenode) Added task CONNECT - Server sterling.freenode.net port 6667 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (DalNet) Added task CONNECT - Server soho.ix.us.dal.net port 6667 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (SPEpisodes) Added task CONNECT - Server irc.spepisodes.com port 6667 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (GameSurge) Added task CONNECT - Server gigenet.il.us.gamesurge.net port 6667 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (ChatSpike) Added task CONNECT - Server stitch.chatspike.net port 6667 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (IRCHighWay) Added task CONNECT - Server hiroes.de.eu.irchighway.net port 6667 (if enabled: delay 0 sec.)
20070527-105609 (Beavis) NETQUEUE: (Abjects) Added task CONNECT - Server wolfpac.ca.us.abjects.net port 6667 (if enabled: delay 0 sec.)
(note: the network addition order is randomized)
With the first alias, the addition of these jobs (about 15 alias executions) took 41 secs, and with the second alias it all happenend in the same second.
Regarding your proposal of using a space as token separator (which is no option in my case since the tokens may contain spaces), in the end, a space is just another character choice, like my token separator (ascii code 215) or any other.
The only difference is that there is a wildcard symbol & that handles a space as separator, which apparently delivers some performance gains in the filtering method.
Why wouldnt it be possible to tell it to see another character as separator, so those performance gains can also be achieved for other than space-separated token strings. Maybe a new wildcard symbol like &<asciicodehere>.
Anyways, that last was just in case the currently used matching method cannot be made better, which is rather hard to believe, considering even a scripted loop with $gettok($line(@window,%loopcounter),18,215) also finishes in the same second.
By messing around with this, I noticed a weird thing:
If I type this on commandline:
//var %ctime = $ctime | SC_NetQueue_CountIdentDBusy | echo -s $calc($ctime - %ctime)
It takes around 5 sec (the @window has 15 lines) but it echoes 6 (6 millisec), what explains this?