guybedford / es-module-lexer

Low-overhead lexer dedicated to ES module parsing for fast analysis
MIT License
917 stars 48 forks source link

opt: minor refactoring for footprint, perf #114

Closed guybedford closed 2 years ago

guybedford commented 2 years ago

Some refactoring work.

Footprint before:

    dist/lexer.js:  4,516B Brotli (10,683B raw)
dist/lexer.asm.js:  4,703B Brotli (16,889B raw)

Footprint after:

    dist/lexer.js:  4,503B Brotli (10,663B raw)
dist/lexer.asm.js:  4,632B Brotli (16,726B raw)