Experiment with this example yourself. Just remember to run
npm install to recompile the addon if you change any C++ code.
If your Node app’s sole purpose is to compute prime numbers and you don’t want to use a fast lookup table, please rely on this benchmark 100%. For anything else, this benchmark is probably useless.
Computing the first 1,000,000 prime numbers without warm up
Computing prime numbers without adaptive optimizations