greg@sparky:~/perl$ cat hashing_short #!/usr/bin/perl my $short="a"; my $long="This is a long hash key"x1000; my %h; $h{$short}++ for (1..1000000); greg@sparky:~/perl$ time hashing_short real 0m0.376s user 0m0.375s sys 0m0.001s greg@sparky:~/perl$ cat hashing_long #!/usr/bin/perl my $short="a"; my $long="This is a long hash key"x1000; my %h; $h{$long}++ for (1..1000000); greg@sparky:~/perl$ time hashing_long real 2m46.893s user 2m38.196s sys 0m0.278s
In reply to Pathological example
by sleepingsquirrel
in thread code execution speed and variable name length
by zentara
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |