js_of_ocaml icon indicating copy to clipboard operation
js_of_ocaml copied to clipboard

Compiler: refactor sourcemap generation, use Index sourcemap

Open hhugo opened this issue 1 year ago • 7 comments

This PR leverages the recent support for index sourcemap to make sourcemap generation faster. We no longer decode or edit mappings.

When compiling cma to js. We emit one sourcemap section per compilation unit. This allows to copy one compilation unit with its mappings without having to decode/change its mapping.

Perf

Compiling js_of_ocaml with itself (dune build compiler/bin-js_of_ocaml/js_of_ocaml.bc.js). The final link time goes from 660ms on master to 440ms with this PR

Building the toplevel in toplevel/examples/lwt_toplevel/, The final link time goes from 1350ms (620 ms processing sourcemap) on master to 730ms (90ms processing sourcemap) with this PR

X-link

build on #1714 replace #1617 fix #1446

hhugo avatar Oct 17 '24 10:10 hhugo