Help for this page

Select Code to Download


  1. or download this
    #! perl -slw
    use strict;
    ...
        ++$hash{ join $;, $x, $y, $z };                                   
    +      106 036 953         40%
        ++$hash{ pack 'Q', $x * 1.2e6**2 + $y * 1.2e6 + $z };             
    +       98 388 672         36.5%
        ++$hash{ unpack 'A6', pack 'Q', $x * 1.2e6**2 + $y * 1.2e6 + $z };
    +       96 193 539         35.6%
    
  2. or download this
    C:\test>perl -E"say join ' ', int( rand 20 ), sort{ $a<=>$b } int( ran
    +d 1.2e6 ), int( rand 1.2e6 ) for 1 .. 1e6" 
    | sort 
    | perl -nle"if($last eq $_){ ++$n }else{ print qq[$last : $n];$n=1} $l
    +ast=$_" 
    | wc -l
     999978