From: David Alan Black Date: 2000-12-31T03:53:31+09:00 Subject: [ruby-talk:8367] Re: speedup of anagram finder Hello again -- On Sun, 31 Dec 2000, SHULTZ,BARRY (HP-Israel,ex1) wrote: > My benchmarks are different; they still show primes as faster. Below you'll > find what I've done. > Can someone tell me what's wrong with it?? Interesting. Based on exactly your code (all I did was change the input file name [and remove the hyphen from Bhagavad-Gita :-]), I'm getting: user system total real primes 3.660000 0.010000 3.670000 ( 3.669972) unpack 2.800000 0.010000 2.810000 ( 2.808476) primes 3.230000 0.000000 3.230000 ( 3.227572) unpack 2.720000 0.000000 2.720000 ( 2.725597) I then thought maybe taking the asc2prime assignment out of the method would speed it up, but: user system total real primes 3.630000 0.030000 3.660000 ( 3.654865) unpack 2.540000 0.010000 2.550000 ( 2.652403) primes 3.280000 0.000000 3.280000 ( 3.293865) unpack 2.490000 0.000000 2.490000 ( 2.486077) I guess it's OS-related -- ?? Or Ruby version-related? candle:~/hacking/ruby$ ruby -v ruby 1.6.2 (2000-12-25) [i586-linux] David (watching the blizzard of '00 from my study....) -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav