My attempts all use gigs of memory and run 10x as long.

#!/usr/bin/perl -w
print "Filling the array with 250000 entries.\n";
foreach $n (0 .. 250000) {
  $x = int(rand(500000));
  $y = int(rand(500000));
  $a{$x}{$y}=1;
}

print "Reading from the arrary 10000 times\n";
$hits=0;
foreach $n (0 .. 10000) {
  $x = int(rand(500000));
  $y = int(rand(500000));
  if (defined $a{$x}{$y}) {
    $hits++;
  }
}

print "Done\n";


-- 
Visit www.kiatoa.com, a user-run, self governing
web site.


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to