Of course it's going to be slow for extremely convoluted wildcards like that. It takes a hell of a lot of processing to correctly match against a string with 23 wildcards in it. The code could probably be optimised a bit but the key issue here is that's not the best way to do what you want.
Instead of using a massive wildcard why not use
/filter's
-k switch and let an alias process each line. That way it'll take a fraction of the time.
alias testfilter {
[color:red]set -u0 %_testfilter 1 *×15 ON×21 ON[/color]
var %ticks = $ticks
var %w = @ChannelList1 | window %w | clear %w
aline -p %w Network1×#channel1×<NOKEY>×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×ON×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×DESCRIBE×OFF
aline -p %w Network2×#channel1×<NOKEY>×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×ON×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×DESCRIBE×OFF
aline -p %w Network3×#channel1×<NOKEY>×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×ON×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×DESCRIBE×OFF
aline -p %w Network4×#channel1×<NOKEY>×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×ON×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×DESCRIBE×OFF
aline -p %w Network5×#channel1×<NOKEY>×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×ON×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×DESCRIBE×OFF
aline -p %w Network6×#channel1×<NOKEY>×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×ON×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×OFF×DESCRIBE×OFF
window @TMP | clear @TMP | [color:red]filter -wk %w matchwm1[/color]
echo -s $calc(($ticks - %ticks) / 1000)
}
[color:red]alias matchwm1 {
var %i = 1
while $gettok(%_testfilter,%i,215) {
if ($gettok($v1,2,32) !iswm $gettok($1-,$gettok($v1,1,32),215)) return
inc %i
}
aline -p @TMP $1-
}[/color]
Notice the first highlighted line. A global variable called
%_testfilter just needs to be set with the same info as you were previously giving as the second parameter to
$makewm1() before the actual filter is called.
This method takes well under a second.