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

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.