|
|
|
|
|
by ryanplant-au
3154 days ago
|
|
Does JavaScript make it easier to reason about those potentially-optimizable areas? Which language features make it easier to optimize to the level that V8 is? (V8 being 7-10x faster than CPython 3 on most of the Benchmarks Game.) |
|
You might not use those hooks a lot in your application code, but it seems that web frameworks and the like do a lot of reflection, which makes the code difficult/impossible to optimize (even at runtime with a JIT).
Python also has __add__ (operator overloading) and JavaScript doesn't. This is a good talk about how subtle or crufty the semantics of something like "a+b" is in Python:
https://www.youtube.com/watch?v=IeSu_odkI5I
The PyPy developers had to copy a lot of the implementation details of CPython, which doesn't always result in the fastest code.