-
Notifications
You must be signed in to change notification settings - Fork 28
Improve performance of esnstrument #8
Comments
Another thought was to generate code strings where convenient, cache them in the AST, and then modify escodegen to use cached strings when available. But, this would involve using a hacked version of escodegen. |
One other tidbit: running with |
any idea if my traversals are also using massive amount of memory. Sent from Samsung Mobile -------- Original message -------- One other tidbit: running with --trace_gc shows that the escodegen phase allocates a massive amount of memory: heap goes from ~200MB to between 500MB and 800MB for pdfjs. So somewhere it's allocating a ton of temporary objects. — |
Doesn't look too bad from a GC trace. Will have to profile in the browser
|
We got significant improvements by switching to acorn for parsing and patching a performance bug in escodegen. Will leave this open, as instrumentation is still a bit slow. |
Right now, instrumenting code is a bit slow. I've put the v8 profiling output for instrumenting pdf.js here. One concerning thing is that ~20% of time is spent in GC; would have to dig in further to see why.
Otherwise, I don't see any quick fixes. The major change I can think of would be to not transform the AST and use escodegen, but instead generate the instrumented code string directly during the AST pass. Not sure how nightmare-ish this would be, though.
Other thoughts welcome :-)
The text was updated successfully, but these errors were encountered: