Just another Perl shrine | |
PerlMonks |
Re: Optimizing binary file parser (pack/unpack)by Corion (Patriarch) |
on Oct 03, 2017 at 08:12 UTC ( [id://1200589]=note: print w/replies, xml ) | Need Help?? |
Depending on whether you actually need to unpack each record or not, you can maybe hardcode the offsets to reject rows before actually unpacking them. index can quickly look at a position in a string without needing pack or unpack. Depending on how you unpack things, it might be quicker to build one large unpack template instead of unpacking items in a loop.
In Section
Seekers of Perl Wisdom
|
|