mIRC Home    About    Download    Register    News    Help

Print Thread
#106748 03/01/05 02:06 PM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
which works faster, im reading lines from a large text file to parse out sertain matches(.zip) what's the general concensus for outputting this for speed does

if ( *.zip* iswm $read( %filter.file , %filter.n ) )

work faster than

if ( .zip isin $read( %filter.file , %filter.n ) )

im using iswm at the moment but it seems sluggish (over 10 minutes for a 45000 line file, called using timer -m 0 1
which by my reckoning should be 45 seconds so i'm taking it the reading/comparing is holding it up.

whats the opinion on here?


billythekid
#106749 03/01/05 02:20 PM
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Isin would logically be faster simply because it's a more fundamental matching method than wildmasks, however the speed difference between the two in this case is most likely negligable. The source of slowdown is your method of accessing the file. Timers and $read() will slow down the process immensely. The command you want is /filter.

This example will output each matching line to the custom window @test.
Code:
window @test
filter -fw "C:\somefilename.txt" @test *.zip*


See /help /filter for the details. That should cut your file filtering time from around 10 minutes to a couple of seconds.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
#106750 03/01/05 02:45 PM
Joined: Mar 2003
Posts: 612
B
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Mar 2003
Posts: 612
yeah thought about using @windows then outputting with savebuff, should have gone with that(original) idea! lol thanks sbm wink

[Edit] Gone back and changed it(removing about 100 lines of code in the process) now using the /filter and got it down from over 10 minutes to less than 2 seconds. Nice one Starbuck


billythekid

Link Copied to Clipboard