Hacker News new | past | comments | ask | show | jobs | submit login

Nothing new here.

Node wasn't ever really meant to be used for CPU intensive tasks - especially the ones like this which you can fairly easy parallelize.




Exactly, If I were using node and needed to calculate primes I'd probably write some C++ code to handle that part and run it as a server in a separate process that can be called asynchronously from node.


Hopefully you'd try another algorithm before you did that ;). Primality tests are one of the most highly understood and well documented areas of CS - trial division has been obsolete since, what, 1640?


... trial division has been obsolete since, what, 1640?

Longer than that. The sieve of Eratosthenes is attributed to Eratosthenes, who lived from 276 BC to 195 BC.


Hah, this exact thing occurred to me lying in bed last night :)




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: