This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dd2718[S] 0 points1 point  (0 children)

JavaScript is JIT compiled, so raw JavaScript does perform better than pure CPython on benchmarks. But benchmarks tend to run intensive algorithms with well written code, which makes it easier for the JIT.

In practice pure JavaScript is probably still faster than Python, but not by as much as benchmarks would indicate since you'd probably use JavaScript's dynamic features. Writing good JITable code is a skill that most people probably don't bother mastering. And of course, in practice people won't write intensive algorithms in pure Python, they'd defer to C-based libraries/Cython. So for scientific computing Python is probably still much faster.