Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

(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.

               s aamecha.s a..a\u$&owag.print
  • Comment on (MeowChow) Re3: (Efficiently) comparing arrays

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://156614]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (5)
As of 2018-05-24 22:33 GMT
Find Nodes?
    Voting Booth?