gosieve icon indicating copy to clipboard operation
gosieve copied to clipboard

An efficient sieve of Eratosthenes using CSP channels in Go


Prime numbers sieve implementations using CSP channels in Go.

./sieve1.go Taken from the Go language tutorial, worse than trial division

./sieve2.go Eratosthenesque, simple implementation

./sieve3.go Eratosthenesque, with wheel optimization and more efficient implementations of PeekChHeap and sendproxy, the result is about 4x faster than ./sieve2.go

I wrote about it here: http://blog.onideas.ws/eratosthenes.go