
On 15/07/07, Hugh Perkins
On 7/15/07, Sebastian Sylvan
wrote: [me thinks he doth protest too much] ;-) The rules of the competition are quite fair: both sides make an optimal algorithm using their preferred language. It's ok to hardcode the first 3 or 4 primes if you must, hardcoding the entire resultset is out ;-)
Why? How may primes are there amont the first 2^32-1 numbers? Shouldn't be unreasonable to just stick it in a table/map if all you're interested in is getting the fastest result regardless of algorithm... Seems quite arbitrary that you allow various tricks to make C# look better (it might still be faster, but I haven't seen you do a fair comparison yet!), but won't take it to its logical conclusion! If you *are* interested in a fair comparison I recommend you don't cheat in either language, and try to write a more general algorithm for both, that have the same properties (e.g. lazy streams of primes in both, or a fixed up-front allocated array of primes in both). -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862