You have a nice fast machine. By way of comparison, how long does the native ocamlopt code take to solve the prime?
Weirdly, if I put the script tag in the body and omit the Lwt onload event, the JSOO code runs slightly slower for me. Loading it in the head seems to improve the chance of the JITer getting on the fast path, particularly if reloading the page.
Edit By the way, I don’t have rescript installed but if I tweak your rescript-generated primes.js file by omitting the imports of curry.js and caml_int32.js and substituting standard javascript, the rescript version runs slightly faster than the JSOO version in chrome and slightly slower in firefox. So it seems pretty much-of-a-muchness.