From: Brad Wilson Date: 2005-06-28T09:57:19+09:00 Subject: Re: I saw the beauty of Ruby Re: 1. Ruby result: 101 seconds , 2. Java result:9.8 seconds, 3. Perl result:62 seconds On 6/26/05, Florian Gro� wrote: > And what if you Use C# 2 features like generics and Array.Map? I'm not sure what "Array.Map" is. The Whidbey beta 2 docs didn't show a method off of Array or Array<> named Map. Replacing ArrayList with List resulted in identical execution times for 50,000 items, so I presumed it was a statistically insignificant sampling (using DateTime.Now is a very low res way of finding time differences, and anything under 1s is probably suspect anyway). I ran 5 million. Non-generic .NET is ~ 50x faster than Ruby (probably was before too, but we couldn't tell because of the smallish sample size). Generic .NET ran ~ 1.2x faster than non-generic .NET. All things considered, that's a decent showing for interpreted/latent typed vs. JITted/strong typed. C:\> ruby primes.rb 348513 time taken 197.84 seconds C:\> primes.exe 348513 Time taken: 00:00:04.0000512 C:\> primes-generic.exe 348513 Time taken: 00:00:03.3125424