posthaste
v0.0.3
Published
Optimize code using static analysis
Readme
Posthaste
Optimize code using static analysis
Proof of Concept
Install
npm i -g posthasteUsage
Mark areas of code that you wish to optimize
with // posthaste optimize:
var x = 1
// posthaste optimize:
var obj = {
a: x,
b: 2
}
console.log(obj)posthaste input.js > output.jsOptimizations
Currently the only supported optimization is to convert object literals into constructed objects.
This has two advantages
- For a frequently queried or mutated object it enables v8 hidden classes optimization
- When profiling, objects are identified by constructor - object literals all come under
the same type
Objectwhich tends to swamp any indication of a memory leak.
