That's interesting but your time or 0.7 seconds on your specified machine isn't very informative: you should at least specify how long the original version of primegen (which is not multithreaded) takes, which we assume as about 0.7 seconds, and also how long your golang version takes without multithreading (or set "maxprocs := 1") Also, one should really convert Bernstein's "eratspeed" to golang for comparison.
Current versions of golang are not as fast as GCC C/C++ optimized code by at least a factor of two, and you will find that if one applies maximum wheel factorization (ie a 2/3/5/7 wheel plus pre-culling for primes of 11/13/17/19), rather than the limited 2/3/5 wheel factorization Bernstein used in eratspeed, that the Sieve of Eratosthenes will beat "primegen" for every range when comparing like for like (multithreading or not for both, written in the same language), and that golang will currently always be a factor slower than the C/C++ code due to less efficient compilation. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.