Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Link_js performance #1875

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

OlivierNicole
Copy link
Contributor

This is a pair of patches by @Enoumy, in use in the internal version of JSOO at Jane Street.

@hhugo
Copy link
Member

hhugo commented Mar 12, 2025

What improvement does that give in practice?

@OlivierNicole
Copy link
Contributor Author

See the first commit message. In addition, when building js_of_ocaml with itself in separate compilation mode, the final linking step falls down from ~550ms on master to ~120ms here.

@OlivierNicole OlivierNicole force-pushed the link-perf branch 2 times, most recently from f4ee91d to cf69bb8 Compare March 12, 2025 18:46
Enoumy and others added 4 commits March 13, 2025 00:56
This saves calls to `String.is_prefix` for the different kinds of
"metadata" lines. @Enoumy measured on an internal project that it can
save 20ms-40ms when linking, and up to ~120ms when `--pretty` is set.
Js_of_ocaml's linker used to read line-per-line each file twice. This
patch is a performance optimization that changes the js_of_ocaml linker
to read each file once, and also read the files "all at once". This
speeds up linking, at the cost of extra peak memory utilization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants