in reply to Re^2: Null-stripping performance
in thread Null-stripping performance
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 }
|
|---|