Thanks for bringing this to my attention and for your interested in num-utils. Indeed if you are processing a large list of numbers, it will take some time so even after I fix the problem in numgrep, it will still take more than a little time if you give it extremely large sets (more than a couple million lines).
Upon looking at the code and testing a simpler version that just does factoring, I found that the slow down happens because of the way I am processing the list of expressions that one can put into the numgrep expression. Basically, for each line of input, it goes through each of the expressions that you have specified and checks it against the line that it is processing. I could probably make it be a bit more efficient by removing some of the overhead. Honestly, this program is at an early stage because I'd like to be able to have the // expression part exist within another regex expression string like you would have in egrep or something. That way it isn't just limited to checking numeric only lines. So any performance improvement now might be lost later as more functionality is added. I wrote a smaller program that just does the factor check and came up with these numbers: $ time seq 1 1000001 | ./numgrep /f777777/ [.snip.] real 0m56.715s user 0m58.096s sys 0m0.016s $ time seq 1 1000001 | ./numgrep-factor-test (assumes a factor of 777777) [.snip.] real 0m1.396s user 0m2.484s sys 0m0.004s So obviously there is some room for improvement. :-) FYI, this was done on a dual Xeon 2.8GHz system with 2GB of ram and no load. Its worth noting that it took the exact same amount of time for numgrep-factor-test to process the list as it did for "| wc -l" to do so. So the problem here is NOT perl. I'm hoping to get a new version of num-utils out this fall, I'll try my hardest to make speed improvements in numgrep (and also random). Right now I have to work on other things. -- Suso Banderas [EMAIL PROTECTED] ________________________________________________________________________ Anarchy only works when there are leaders. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]