|
|
|
|
|
by fenomas
3045 days ago
|
|
Expensive optimizations like what? Can you give a before/after example of something such a tool might do? (Note: I'm glossing over the case where one is using bleeding-edge syntax that a JS engine doesn't yet know how to optimize. In that case preprocessing out the new syntax is of course very useful, but I don't think this is the kind of optimization the GP comment was talking about.) |
|
As an example for something that static analysis could have caught, take the example from the article about the "Argument Adaptation"[0]. Here the author uses profiling to learn that by matching the exact argument count for calling a function, instead of relying on the JS engine to "fix that", the performance can be improved by 14% for this particular piece of code. Static analysis could have easily caught and fixed that, essentially performing a small code refactoring automatically just like the author here did manually.
[0] http://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-...