-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
base: main
Are you sure you want to change the base?
update jsoo for testing #1909
Conversation
9db139a
to
7d070c5
Compare
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))) |
I'm wondering if the slowdown could be due to |
The current implementation:
An alternative approach can mitigate the perf issue |
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. |
With the commit, you no longer need to disable |
@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? |
@phated, would you be able to rebase this branch, I have some time to look at this again. |
edcf68b
to
7a7cb55
Compare
@hhugo I rebased this. We changed the way a lot of the code that we previously thought needed updating works, so once the CI finishes we should see how long the tests take and then go from there. Thanks for looking into this again! |
@phated, I've identified a change that make every thing slow. You enable backtraces unconditionally in module_resolution. Try enabling backtraces only when not running with jsoo. let () = Printexc.record_backtrace(Sys.backend_type != (Other("js_of_ocaml"))); |
I've make some cleanup in https://github.com/hhugo/grain/tree/cleanup but it's missing an upgrade to js_of_ocaml-compiler.5.8.2. |
@hhugo thanks! Locally, at least, that seems to be the issue. I committed that change here so we can see how fast the tests run. We'll likely also pull the rest of your cleanup into this branch. Really appreciate you looking into this! |
It looks like the tests are still running slow. Locally I just compiled a program and compared the performance against |
I think the issue is that 3rd party libs enable backtraces. See https://github.com/reasonml/reason-native/blob/20b1997b6451d9715dfdbeec86a9d274c7430ed8/src/rely/Util.re#L12 You can try overriding caml_record_backtrace with //Provides: caml_record_backtrace
function caml_record_backtrace(b){
// caml_record_backtrace_flag = b;
return 0;
} |
Here is what I have locally after tweaking the generated code manually.
|
Gotcha, that looks like it. Just pushed that change. |
@ospencer, I've just merged ocsigen/js_of_ocaml#1637, would you be able to test js_of_ocaml-compiler master here ? (dropping the compiler/test/hacks.js override) |
@hhugo Apologies for the delay, I just pushed that change. |
opening this draft for windows CI testing purposes