while (<XCH0S>) { @array = split(",", $_); $array[2] =~ tr/A-Z/a-z/; chomp $array[2]; $xch0{$array[2]}++; } while (<XCH3S>) { @array2 = split(",", $_); $array2[2] =~ tr/A-Z/a-z/; chomp $array2[2]; if (!defined $xch0{$array2[2]}) { print "DN of extra record is: $array2[2]"; } else { next; } }
Benchmark: timing 10000 iterations of my code, their code... my code: 1 wallclock secs ( 0.92 usr + 0.06 sys = 0.98 CPU) @ 10 +193.68/s (n=10000) their code: 0 wallclock secs ( 0.13 usr + 0.05 sys = 0.18 CPU) @ 55 +555.56/s (n=10000) (warning: too few iterations for a reliable count) C:\network>cmp2.pl Benchmark: timing 110000 iterations of my code, their code... my code: 3 wallclock secs ( 1.97 usr + 0.51 sys = 2.48 CPU) @ 44 +301.25/s (n=110000) their code: 2 wallclock secs ( 1.63 usr + 0.37 sys = 2.00 CPU) @ 54 +917.62/s (n=110000) C:\network>cmp2.pl Benchmark: timing 1000000 iterations of my code, their code... my code: 16 wallclock secs (11.07 usr + 4.80 sys = 15.86 CPU) @ 63 +043.75/s (n=1000000) their code: 18 wallclock secs (13.78 usr + 4.59 sys = 18.37 CPU) @ 54 +445.47/s (n=1000000) C:\network>cmp2.pl Benchmark: timing 2000000 iterations of my code, their code... my code: 33 wallclock secs (21.50 usr + 9.36 sys = 30.86 CPU) @ 64 +800.41/s (n=2000000) their code: 40 wallclock secs (28.05 usr + 8.83 sys = 36.88 CPU) @ 54 +226.99/s (n=2000000)
In reply to Re: Re: using hash uniqueness to find the odd man
by novitiate
in thread using hash uniqueness to find the odd man
by novitiate
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |