in reply to Bug when undefining a large hash
use strict; use warnings; use Time::HiRes qw(time); # Create a large hash my %hash; my $count = 3_000_000; $hash{$count} = rand(10) while $count--; # Undefine it print "Undefining hash.\n"; my $before = time; undef %hash; printf "Done in %.03f seconds\n", time - $before;
On my linux box it's about 1.5s for both perl 5.8.8 and perl 5.10.0.
I suspect that might be due to a different malloc in windows and linux, so my next step will be do compile a perl with a different malloc, and try again.
Update: A perl configured with -Uusemymalloc took 1.4s, so no real difference.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Bug when undefining a large hash
by oxone (Friar) on Aug 22, 2008 at 13:55 UTC | |
Re^2: Bug when undefining a large hash
by dextius (Monk) on Aug 27, 2008 at 13:15 UTC |