I was curious so I took the same code, added a timer, and ran it on win32. It took 10 seconds. However, I'm running a 1.8 Pentium M, 1G of memory, WinXP, ActivePerl 5.8.6.
I suspect that nite_man does not have as beefy of a box as you do. It might be acceptable if the look up doesn't occur frequently.
In retrospect, it wasn't a good test since the system specs weren't the same and I'm not fimilar with the whole problem. But it was a good 30 second distraction. :)
For the curious:
#!perl -w use strict; my $startTime = time(); my %lookupTable; for (my $i=0; $i<=2000000; $i++) { if (!$lookupTable{$i}) { $lookupTable{$i} = 1; } } my $totalTime = time() - $startTime; print "Total Time: $totalTime\n";
In reply to Re^4: How to remove duplicates from a large set of keys
by FitTrend
in thread How to remove duplicates from a large set of keys
by nite_man
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |