> >there must be a flaw in my test here: > > > >my @bob = rand for (1..20); > >my @joe = rand for (1..10_000); > > Those. > > my @bob = map rand, 1 .. 20; > my @joe = map rand, 1 .. 10_000; >
duh... thx of course, the results still favor sort: Benchmark: timing 1000000 iterations of for 10_000 elems, for 20 elems, sort 10_000 elems, sort 20 elems... for 10_000 elems: 7 wallclock secs ( 5.11 usr + 0.02 sys = 5.13 CPU) @ 194931.77/s (n=1000000) for 20 elems: 8 wallclock secs ( 5.44 usr + 0.01 sys = 5.45 CPU) @ 183486.24/s (n=1000000) sort 10_000 elems: 4 wallclock secs ( 2.99 usr + -0.02 sys = 2.97 CPU) @ 336700.34/s (n=1000000) sort 20 elems: 3 wallclock secs ( 3.22 usr + -0.04 sys = 3.18 CPU) @ 314465.41/s (n=1000000) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]