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

update jsoo for testing #1909

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft

update jsoo for testing #1909

wants to merge 12 commits into from

Conversation

phated
Copy link
Member

@phated phated commented Sep 4, 2023

opening this draft for windows CI testing purposes

@hhugo
Copy link

hhugo commented Oct 16, 2023

Try with this diff

diff --git a/compiler/test/dune b/compiler/test/dune
index a8b92d0c..111938bc 100644
--- a/compiler/test/dune
+++ b/compiler/test/dune
@@ -22,4 +22,4 @@
  (libraries grain grain-tests.framework grain-tests.suites grain-tests.utils)
  (modules test)
  (js_of_ocaml
-  (flags --no-sourcemap --quiet)))
+  (flags --no-sourcemap --quiet --disable use-js-string)))

@hhugo
Copy link

hhugo commented Oct 16, 2023

I'm wondering if the slowdown could be due to yojson reading "cmi" pattern

@hhugo
Copy link

hhugo commented Oct 16, 2023

The current implementation:

  • first read the cmi section into some bytes
  • convert bytes to string
  • Yojson.from_string convert the string back into bytes

An alternative approach can mitigate the perf issue
hhugo@543d5a9

@phated
Copy link
Member Author

phated commented Oct 17, 2023

Thanks @hhugo! I've cherry-picked that commit into this branch to see it in action. Any idea why this issue is only showing up now (with this upgrade)?

@hhugo
Copy link

hhugo commented Oct 17, 2023

Thanks @hhugo! I've cherry-picked that commit into this branch to see it in action. Any idea why this issue is only showing up now (with this upgrade)?

js_of_ocaml-compiler.5.1.0 changed the default representation of strings.

@hhugo
Copy link

hhugo commented Oct 17, 2023

With the commit, you no longer need to disable use-js-string.
I've created a branch with additional changes.
see https://github.com/hhugo/grain/tree/hhugo-jsoo-oom

@phated
Copy link
Member Author

phated commented Oct 24, 2023

@hhugo the tests have still gone from 3-4 minutes to 16 minutes with the newer JSOO. This seems untenable for us since our compiler binaries are produced via jsoo. Do you have any other ideas why there would be a 400% slowdown between the versions?

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.

None yet

2 participants