mozilla-spidermonkey / jsparagus

Experimental JS parser-generator project.
Other
447 stars 20 forks source link

Jsparagus lexer is 42% slower than SpiderMonkey's lexer #589

Open nbp opened 4 years ago

nbp commented 4 years ago

This result comes from the following profile where both SmooshMonkey and SpiderMonkey succeed: https://share.firefox.dev/38DHNBm

Under js::frontend::GeneralParser::parse, filtering with Token highlights that we spent 3.407s in the lexer. Under smoosh_test_parse_script, filtering with lexer highlights that we spent 4.858s in the lexer.

nbp commented 4 years ago

One aspect to be noted, while running DHAT valgrind tool (after disabling jemalloc), is that declare and declare_var are the major source of short-lived allocation/reallocation through std::collections::hash::map::HashMap<K,V,S>::insert.

Maybe we should consider using a sparse BitSet or the EntitySet from cranelift.