in reply to Perl array performance puzzle

It is just noise. Or rather, stuff like the effects of cache alignment etc. Try swapping a1 and a2 round in the benchmark calls and you'll find you get a whole new set numbers, with no obvious correlation of one array consistenly being faster than the other.

Dave.

Replies are listed 'Best First'.
D'oh!
by fizbin (Chaplain) on Jul 30, 2004 at 16:22 UTC
    Mea culpa.

    You're right - it is just noise, though I don't get different numbers from swapping things around in the code. I do however get very different numbers based on what other programs are open at the same time on my laptop. Before, I had just been running the same program in a loop with the laptop otherwise idle.

    -- @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/