Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^3: Null-stripping performance

by BrowserUk (Pope)
on Feb 26, 2007 at 15:45 UTC ( #602153=note: print w/replies, xml ) Need Help??


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 }

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://602153]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2021-05-14 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (150 votes). Check out past polls.

    Notices?