Re:Node.js 14 is over 20x faster than Python3.8 for fib(n)
by richardwhiuk on Tuesday February 09, 2021 @01:06PM
(#26080638)
This is a pretty terrible implementation of fib(n).
[ Parent
| on HN ]
Re:Node.js 14 is over 20x faster than Python3.8 for fib(n)
by meetups323 on Tuesday February 09, 2021 @01:07PM
(#26080649)
It's a common approach to measuring function spawn cost.
Re:Node.js 14 is over 20x faster than Python3.8 for fib(n)
by da_chicken on Tuesday February 09, 2021 @01:16PM
(#26080757)
Maybe, but it's also why synthetic benchmarks are not convincing. Maybe node better handles a bad pattern, but if performance is a concern to this level we're more concerned about functionally equivalent good patterns even if the code is very different.
Re:Node.js 14 is over 20x faster than Python3.8 for fib(n)
by atleta on Tuesday February 09, 2021 @01:44PM
(#26081092)
I think GP meant how the fib function was written (and not why it was chosen for the measurement). The `if n == 1 or n == 0` thing hurts my eyes too.
Re:Node.js 14 is over 20x faster than Python3.8 for fib(n)
by nullcat on Tuesday February 09, 2021 @01:18PM
(#26080786)
Regardless node IS definitively one of the fastest interpreted platforms around. It is well known that it is faster than python. Python wins in other areas, including being a much much better designed language.
Re:Node.js 14 is over 20x faster than Python3.8 for fib(n)
by tracker1 on Tuesday February 09, 2021 @05:51PM
(#26083579)
Probably comes from V8 (JS engine in node), likely being the most heavily optimized language runtime engine ever made.
Re:Node.js 14 is over 20x faster than Python3.8 for fib(n)
by killsgnadfamily on Friday February 12, 2021 @12:46AM
(#26111073)
Agreed. They have some of the smartest people working on that.