Ask HN: How to speed up primesieve.org port to Go

1 points by caleblloyd ↗ HN
I've recently ported the primesieve.org algorithm outlined to Go: https://github.com/caleblloyd/primesieve

The algorithm runs pretty fast, but primesieve.org's C version of the program still runs orders of magnitude faster than the Go port that I wrote.

Does anyone have ideas of how to bridge the performance gap so that this Go implementation performs closer to that of the C version supplied by primesieve.org? Or is the slowdown simply the result of running in a Garbage Collected language?

Primesieve.org segmented sieve algorithm outline: http://primesieve.org/segmented_sieve.html

Primesieve.org performance times: http://primesieve.org/

Primesieve.org C Source on GitHub: https://github.com/kimwalisch/primesieve

0 comments

[ 3.2 ms ] story [ 12.1 ms ] thread

No comments yet.