-
Notifications
You must be signed in to change notification settings - Fork 188
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
[BUG] js_of_ocaml is excessively memory hungry #1612
Comments
`js_of_ocaml` is too heavy for M1 GH Action runners which have only 7GB RAM, cf ocsigen/js_of_ocaml#1612, https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
`js_of_ocaml` is too heavy for M1 GH Action runners which have only 7GB RAM, cf ocsigen/js_of_ocaml#1612, https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
`js_of_ocaml` is too heavy for M1 GH Action runners which have only 7GB RAM, cf ocsigen/js_of_ocaml#1612, https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
With the change mentioned, I the following for
|
@hhugo Regarding this, I have been working on the sourcemap slowness and will open a PR today. |
@JasonGross, any luck with #1614 ? |
I have not had a chance to try it, but if it works on your end, I don't see why it would be any different on GitHub Actions. (The files I linked to are the ones I actually use, not simplified examples .). But I can set up GHA to use the PR. Should I just clone the repo and |
#1617 may help too if the memory consumption happens to be in sourcemaps. I find that it nearly halves the peak memory usage when linking JSOO using itself. |
@JasonGross, I think you can just do
|
`opam pin add js_of_ocaml-compiler https://github.com/ocsigen/js_of_ocaml.git#speedup` cf ocsigen/js_of_ocaml#1612 (comment)
I've set it up on CI: |
`opam pin add js_of_ocaml-compiler https://github.com/OlivierNicole/js_of_ocaml.git#optim_sourcemap_link` cf ocsigen/js_of_ocaml#1612 (comment)
Not all CI jobs have been updated. Here is what I see for #1614
|
And for #1617
|
compared to
|
@OlivierNicole, I would expect your PR to only affect separate compilation during the link step but I don't think separate compilation is involved here. What part of your PR would improve the situation during whole program compilation ? |
I didn’t quite follow which of the many jobs to inspect to find the info, but I trust that your numbers are right.
I’m honestly not sure. Looking into it. |
I switched to I’m not sure it explains it all though. Trying to profile locally. |
Yes. The cheapest way to run them is to download any of the artists labeled ExtractionJsOfOCaml-source* from our CI. These artifacts contain a handful of self-contained .ml files, the ones that we want to turn into .js files. I gave the flags I use in the initial post. The expensive way to run the tests is to clone the repo, do |
I can’t reproduce a significant difference in terms of run time nor profile between master and #1617. The time spent on source maps is negligible compared to the time spent optimizing. I’m starting to suspect that the CI run times have a huge variance. |
P.S. I’ve done the test on with_bedrock2_fiat_crypto. Peak memory usage is not significantly affected, either. |
#1614 has been merged. Reopen if you still have issues |
Describe the bug
js_of_ocaml
is very cool! I use it on CI to generate a webpage. However, I cannot use it on the new GitHub Actions arm64 MacOS boxes, which have only 7 GB of RAM, because it sometimes eats 8--9 GB RAM to generate a single .js file. For example here is a table of build times and memory usages on linux:It is similar on mac, and a bit better on debian sid.
I invoke it with
--source-map --no-inline --enable=effects
and invoke the compiler with-package js_of_ocaml -package unix -w -20 -g
For the near future (until artifacts expire), the build artifacts page contains generated .js files (fiat-html-js-of-ocaml), .ml source files (ExtractionJsOfOCaml-source-master), and compiled files (ExtractionJsOfOCaml-master-ocaml-4.11.1).
Expected behavior
I expect there to be a way to make the js_of_ocaml pipeline fit in under 7GB of RAM, possibly with a flag, if necessary.
Versions
js_of_ocaml 5.7.2, ocaml 4.11.1
The text was updated successfully, but these errors were encountered: