From: Phrogz Date: 2006-09-05T00:05:24+09:00 Subject: Re: Happy Numbers (#93) Sander Land wrote: > Just had to test if there was any performance difference, results: > > user system total real > inject(0) 20.320000 5.430000 25.750000 ( 34.486938) > inject 20.450000 5.350000 25.800000 ( 30.152165) > inject &:+ 37.860000 5.690000 43.550000 ( 45.670349) > each 11.130000 3.460000 14.590000 ( 15.042142) > C 0.020000 0.000000 0.020000 ( 0.019815) > > so inject(0) vs inject doesn't really matter. Interesting! Thanks for sharing. I'm surprised that #each with += is so much faster.