Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

(MeowChow) Re3: (Efficiently) comparing arrays

by MeowChow (Vicar)
on Apr 04, 2002 at 10:19 UTC ( #156614=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: (Efficiently) comparing arrays
in thread comparing arrays

The only reason that this is slower than the faq answer, or the solution i just posted, is that you are using map in void context. This is an efficiency no-no.

update: demerphq is also correct, removing the lexical context indeed contributes some of the performance increase. Since this is a one-time performance penalty, its effect will be greater relative to smaller arrays.

   MeowChow                                   
               s aamecha.s a..a\u$&owag.print


Comment on (MeowChow) Re3: (Efficiently) comparing arrays
Re: (MeowChow) Re3: (Efficiently) comparing arrays
by demerphq (Chancellor) on Apr 04, 2002 at 14:09 UTC
    And also because the map he used has a lexically scoped block but the for loop that you used does not. Handling the scope has an overhead associated with it im pretty sure.

    just my $0.02

    Yves / DeMerphq
    ---
    Writing a good benchmark isnt as easy as it might look.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2014-08-20 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (105 votes), past polls