You did only do the unpack to an array once--not every time you needed a number--didn't you?
If that is the case, I'd benchmark combining substr and unpack against the other options:
my $str = ...; sub fetchOne{ unpack 'a4', substr $str, $_[ 0 ] * 4, 4 }
In reply to Re^3: Null-stripping performance
by BrowserUk
in thread Null-stripping performance
by qiau
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |