Do you know where your variables are? | |
PerlMonks |
Re^4: Fast parsing for cypher block chainingby fluffyvoidwarrior (Monk) |
on Mar 01, 2006 at 07:30 UTC ( [id://533590]=note: print w/replies, xml ) | Need Help?? |
Just benchmarked a comparison between sysread/write with substr() and straight perl IO read/write if anyone is still interested. The results are a bit of a shock! Parsing a 700Mb file in 8 byte chunks took 81 seconds with the sysread method. Using perl buffered read/write it took 522 seconds. It seems sysread and handling your own buffering can produce performance gains of upto 700% - which is what I'm looking for. Heres my code just in case I've done anything dumb (I'm assuming using OOP IO is OK)
I originally used a while construct for loop control but then thought maybe it was slowing things down. It was. Using "while" took 522 secs. Using the counter as above took 449 secs. Either way sysread and substr() is loads faster.
In Section
Seekers of Perl Wisdom
|
|