4 ms·
To answer the question, JavaScript is 31x faster out of the box on size 1000000 (compared to the 6x claimed in the post). 71x on 10M. bwasti@bwasti-mbp co
by brrrrrm 4y ago
To answer the question, JavaScript is 31x faster out of the box on size 1000000 (compared to the 6x claimed in the post). 71x on 10M.
bwasti@bwasti-mbp code % time python3 prime.py
78498
python3 prime.py 3.86s user 0.02s system 98% cpu 3.938 total
bwasti@bwasti-mbp code % time bun prime.js
78498
bun prime.js 0.07s user 0.02s system 74% cpu 0.125 total
- zeugmasyllepsis 4y agoI was curious about node/jitless node versus python/pypy: src time node primes.js 78498 node primes.js 1.75s user 0.05s system 102% cpu 1.761 total src time node --jitless primes.js 78498 node --jitless primes.js 5.06s user 0.04s system 100% cpu 5.088 total src time python primes.py 78498 python primes.py 4.27s user 0.03s system 100% cpu 4.276 total src asdf shell python pypy3.9-7.3.9 src time python primes.py 78498 python primes.py 0.91s user 0.07s system 100% cpu 0.970 total Actually relatively on par with one another.