Changelog: swc v1.1.31


parser becomes 10% ~ 15% faster#

swc uses a special technique copied from rustc to store identifers and spans compactly. However, it's memory-performance tradeoff, and encoding and decoding is not super fast operation. So, while parsing, swc use un-compact version of span, and uses compact version of span after parsing. The make parser much faster.

codegen with sourcemap becomes 80% faster#

I designed swc's core module to support merging multiple file into a file. Because of the design, swc used a concurrent data structures while generating code. But it was not enough for performance. I added a cache layer related to source map, and the layer makes swc much faster


emit_colors ... bench: 23,601 ns/iter (+/- 15,849) = 49 MB/s


test emit_colors ... bench: 13,659 ns/iter (+/- 450) = 86 MB/s
test emit_large ... bench: 112,836 ns/iter (+/- 16,139) = 45 MB/s