in reply to Bug when undefining a large hash
using a slightly different program:$ perl hash.pl ; perl hash.pl ; perl hash.pl Create: 5.26445007324219 Destroy: 1.82375288009644 Create: 5.18459510803223 Destroy: 1.82551097869873 Create: 5.14320707321167 Destroy: 1.8236780166626
$ cat hash.pl #!/usr/bin/perl use strict; use warnings FATAL => 'all'; use Time::HiRes 'time'; my $t0 = time; my %hash; $hash{$_} = 1 for 1..3_000_000; my $t1 = time; undef %hash; my $t2 = time; print "Create: ", $t1-$t0, "\nDestroy: ", $t2-$t1, "\n";
$ uname -a FreeBSD XXX.XXX.XXX 7.0-RELEASE-p2 FreeBSD 7.0-RELEASE-p2 #0: Wed Jun +18 06:48:16 UTC 2008 root@amd64-builder.daemonology.net:/usr/obj/ +usr/src/sys/GENERIC amd64
$ perl -v This is perl, v5.8.8 built for amd64-freebsd
And I get very similar results on linux with perl 5.10.0 and 5.8.8
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Bug when undefining a large hash
by oxone (Friar) on Aug 22, 2008 at 14:00 UTC |