in reply to Re: shift v. indexing into an array
in thread shift v. indexing into an array

Hi,

Thanks for the benchmarks. The shift results surprise me, but the my declaration results are what I would expect.

Is there a "setup" option for benchmarking? For instance, allowing you to create the big array before the benchmarking begins.

Replies are listed 'Best First'.
Re^3: shift v. indexing into an array
by bobr (Monk) on Nov 16, 2009 at 09:51 UTC
    The benchmarking works by running the subroutines multiple times (the number is specified by first parameter of cmpthese). It is possible to move initialization outside as far as you don't modify them, which is not the case of pop nor shift.

    -- Roman