Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: How to optimize a regex on a large file read line by line ?by John FENDER (Acolyte) |
on Apr 16, 2016 at 17:55 UTC ( [id://1160658]=note: print w/replies, xml ) | Need Help?? |
"The predefined global variable $. does that for you" Wasn't aware of this trick, thanks ! "Spoiler alert: your file "10-million-combos.txt" does not contain any lines that match /123456$/." Hahem, sound like i've done something wrong while zipping the file. Now the 19x mb file containing 10 millions password are updated in the right way. You will find 10000000 lines in it, and 61466 with the regex 123456$. "unzip -p 10-million-combos.txt.zip | perlscript"Currently i'm working on txt file only. But it's interesting. I've done your test like that :
Result :
0,58 in plaintext, 2,27 in zip file piped. More now with your command line
=Fastest on my side stay the direct access to the plain text file either using grep or perl. Amazing to see the perl unzip goes faster than the plain text access with an inline command... The shell is strange sometimes... "I was going to suggest using the gnu/*n*x "grep" command-line utility to get a performance baseline" Im' using the one you can find in the unix utils, i suppose it's the GNU one ported on windows. --version give me : grep (GNU grep) 2.4.2. Now grep vs perl
Give me :
In Section
Seekers of Perl Wisdom
|
|