Execution speed of jsoo/rescript output?

For code that can compile both under jsoo & rescript, are there rules of thumb regarding execution speed? I.e.

  • A generally faster than B
  • B generally faster than A
  • can’t really tell

You may have better luck finding info about this if you include bucklescript in your searches. For example Benchmarking bucklescript vs js of ocaml.

This is obviously not solid data for you, but it seems from reading various threads about it, that ReScript generates code that’s a little more optimized/fast than jsoo, (likely?) because it can be closer to what you might write by hand.

1 Like

I’m curious to know ballpark relative performance figures for code compiled with ocamlopt, ocamlc and those two JS backends. I’d guess rescript generally outperforms ocamlc but is it 2x slower than ocamlopt or 5x?

There are some pretty detailed benchmarks about that in the jsoo manual. It doesn’t include rescript/bucklescript, but does for ocamlopt, ocamlc, and jsoo and some handwritten JS as well.