|
|
|
good chemistry is complicated, and a little bit messy -LW |
|
| PerlMonks |
RE: RE: sieve of Eratosthenesby maverick (Curate) |
| on Jul 01, 2000 at 17:43 UTC ( #20744=note: print w/ replies, xml ) | Need Help?? |
|
Nice algorithm! The idea of using vectors never occured to me. I went back and uncomment the print statements to see what kind of overhead the grep might cause. At N=100000 I end up with: I would have expected us to end up with closer times, but your's ends up being 24 seconds faster? wow. So, I removed the prints and got: I'm running this on a PII 400, using Red Hat Linux and the stock perl RPM (5.005_03). It would seem that vec is much faster under Linux than under windows. Hmmm...I wonder how these benchmark out on other platforms... /\/\averick
In Section
Snippets Section
|
|
||||||||||||||||||||||