Open Bug 1976889 Opened 3 months ago Updated 3 months ago

28% more time spent in JS parsing on when running m=app Google Slides js

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

People

(Reporter: jrmuizel, Unassigned)

References

(Blocks 2 open bugs)

Details

Firefox
Chrome

One thing stands out is that we seem to have a lot more passes over the AST than Chrome. e.g. js::frontend::NameFunctions and js::frontend::FoldConstants.

Constant folding is unlikely to be helpful on minified code so it's worth questioning whether we should do it all. V8 does some constant folding during parsing which seems like it would be a lot cheaper than doing a whole pass over the AST.

This makes me think of stupid given the scope of this bug, but why don't we generate "structured" bytecode instead of an AST?

The visitor pattern is likely to be simpler and faster as we would have less pointer chasing, with some extra cost of doing memcpy of bytecode chunks.

Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.