4 ms·
Nodejs is incredible fast for a interpreted language. It is only ~4 times slower than Rust and only a bit slower than Go or Java (compiled GC languages) in the
by tutfbhuf 6y ago
Nodejs is incredible fast for a interpreted language. It is only ~4 times slower than Rust and only a bit slower than Go or Java (compiled GC languages) in the benchmarks. Compare that with Python 3, also interpreted but ~30 times slower than Rust.
I know that Python 3 can do some runtime stuff that Nodejs can't, but I wonder whether that's worth so much performance. Maybe if the answer is that you would include C modules in Python if you need the speed, but I don't know if that's a good answer to the problem.
- brundolf 6y agoNode uses V8, which does JIT compilation, while CPython is a straight bytecode interpreter. A better point of comparison would be PyPy
- tutfbhuf 6y agoAre there any CPython vs PyPy benchmarks?
- igouy 6y agohttps://pybenchmarks.org/ https://pybenchmarks.org/
- tutfbhuf 6y agoOkay according to their results: https://pybenchmarks.org/u64q/chartbox.php?s=eNptUtttAzEMW0lPUprC%2B29TGr0kQNP7IU42RYpy2%2F1Ov4DMPR0s6K8yB6exgz60cBXhhO2H8EB7uXhmLkIK53TXFA%2FVq%2FPAyvOb90Bir94m%2BzR3pg4XCxykucUXQVZ006tHQpjYkULYyCd7vD%2B8cJ83RBlTQp4tL7AcNRvaSm9s4%2FIiwv%2FqOafEy6pUTwJ59dbD7nzXLoJzzf%2FhTfTl7a7ORnHGTbAUK4m8ef47X27Hr8GUF4bdLsvsOhMa7%2BqlVUlBYfENqww0QzhDQmhlr8UZTTxkQq694F96KxcrHmL3MG0gwLZSUp7brmmfmxFZL1CzCe22plOrUlFPg8Hknk1n4%2F1eQvv3F2BTYciZmgsKMJcQVT7jiInnvfwA36GR7A%3D%3D&m=eNozMFZwSU1WMDIwMlAoNTMpBAAfLQPk&w=eNpLrizJyM%2FzL6gsLgFTBZVgwhhIgiSM%2FfNKM0uyE6Fc3ZTUMijTP70oMTHHPzczuSgfKpIFoYpKi0sgIgACryZf https://pybenchmarks.org/u64q/chartbox.php?s=eNptUtttAzEMW0l... PyPy seems to be twice as fast as CPython in these benchmarks. While this is indeed a noticeable achievement, it is still much slower than Node.
- deleted 6y ago[deleted]
- Can_Not 6y ago> I know that Python 3 can do some runtime stuff that Nodejs can't Examples? This is too interesting to just throw in then hand wave away.
- tutfbhuf 6y agoHonestly, I don't know. I think I read it somewhere, as explanation for why python is so slow. It made sense to me, that it must be language features. I hope there's someone on HN who can explain it.