Commit Graph

6 Commits

Author SHA1 Message Date
Peter J. Holzer 5d3af658d7 Start goroutines once and use channels to distribute work 2021-07-13 12:09:17 +02:00
Peter J. Holzer cfb18dec75 Avoid overflow 2021-07-13 11:17:37 +02:00
Peter J. Holzer 12cf4f79ff Mark non-primes in parallel goroutines 2021-07-13 00:13:44 +02:00
Peter J. Holzer af97ce448c Use bitmap instead of array 2021-07-12 21:09:22 +02:00
Peter J. Holzer 7384eaccf6 Don't print primes 2021-07-12 21:07:35 +02:00
Peter J. Holzer 27b131c982 Compute and print primes (non-parallel)
This is already a slightly optimized version: I hardcode 2 and compute
only odd primes and I skip multiples of lesser primes in the inner loop.
This roughly matches the algorithm used by Dave Plummer in his Youtube
series. Just to have the same baseline
2021-07-12 19:40:34 +02:00