Node.js 14 is over 20x faster than Python3.8 for fib(n)
1–10 of 119 posts
Re: Node.js 14 is over 20x faster than Python3.8 for fib(n)
#2I'm not sure this is entirely noteworthy unless you somehow think CPython has a JIT. Would be much more interesting to compare to pypy.
Re: Node.js 14 is over 20x faster than Python3.8 for fib(n)
#3Re: Node.js 14 is over 20x faster than Python3.8 for fib(n)
#4An interpreter with a JIT is obviously faster than one without. Especially when dealing with CPU bound work. I'm not sure this is entirely noteworthy unless you somehow think CPython has a JIT. Would be much more interesting to compare to pypy.
Function call is a well-known weak point of cpython, even amongst all its other weak points performance-wise.
It's hard to express how utterly uninteresting and useless TFA is, and if its author is surprised by the result… really the only component this tells us about is the author.
> Would be much more interesting to compare to pypy.
I'm not sure it is more interesting at all, let alone much more, but here are the results on my (obviously much slower than TFA's) machine:
> python3.9 --version
Python 3.9.1
> python3.9 fib.py
8555.904865264893 ms
> pypy37 --version
Python 3.7.9 (7e6e2bb30ac5fbdbd443619cae28c51d5c162a02, Jan 15 2021, 06:03:20)
[PyPy 7.3.3-beta0 with GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
> pypy37 fib.py
715.0719165802002 ms
> node --version
v14.15.4
> node fib.js
247.19056797027588 ms
(can I note that the 12 decimal precision of the script is hilarious? Because clearly when you're benching fib(35) you need that femtosecond-scale precision)Re: Node.js 14 is over 20x faster than Python3.8 for fib(n)
#5Re: Node.js 14 is over 20x faster than Python3.8 for fib(n)
#6This is a pretty terrible implementation of fib(n).
Re: Node.js 14 is over 20x faster than Python3.8 for fib(n)
#7Re: Node.js 14 is over 20x faster than Python3.8 for fib(n)
#8 ~> python fib.py
4825.7598876953125 ms
~> pypy3 fib.py
514.7459506988525 msRe: Node.js 14 is over 20x faster than Python3.8 for fib(n)
#9An interpreter with a JIT is obviously faster than one without. Especially when dealing with CPU bound work. I'm not sure this is entirely noteworthy unless you somehow think CPython has a JIT. Would be much more interesting to compare to pypy.
The fact this is on someones blog and posted to the front page means that a lot of people didn't know this. Well guess what, for you guys who don't know.... here's another fun fact: C++ is about 10x faster then node which makes it about 200x faster then python.
Re: Node.js 14 is over 20x faster than Python3.8 for fib(n)
#10An interpreter with a JIT is obviously faster than one without. Especially when dealing with CPU bound work. I'm not sure this is entirely noteworthy unless you somehow think CPython has a JIT. Would be much more interesting to compare to pypy.