Re:Accelerate Python code by importing Taichi
by brrrrrm on Thursday September 08, 2022 @12:42PM
(#32768126)
how does this compare to a normal JIT compiled language? Hacking on performance to Python seems really brittle
[ Parent
| on HN ]
Re:Accelerate Python code by importing Taichi
by brrrrrm on Thursday September 08, 2022 @01:47PM
(#32769073)
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
Re:Accelerate Python code by importing Taichi
by zeugmasyllepsis on Thursday September 08, 2022 @04:06PM
(#32771323)
I 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.