Ocaml 5.0.0 in Pyre - mostly smooth sailing, Gc.stat regression

Hey folks!

Pyre recently switched our backend build to Ocaml 5.0.0.

It was a smooth switch for the most part. I know a lot of work went into this and we appreciate it!

We did notice one surprising regression - we had to remove a call to Gc.stat that we had for telemetry tracking.

The problem was that when we type-checked our largest Python codebase, that call was taking more than 50 seconds (in 4.14, the same call took well under 1 second).

After asking around we’ve learned that:

  • the Gc.stat implementation did change and some regression is expected
  • we should have been using Gc.quick_stat anyway, which is a change I’ll make soon

Nonetheless we thought it might be good to report this in case the slowness we experienced comes as a surprise.

Steven Troxler


I recommend reporting this upstream (Issues · ocaml/ocaml · GitHub): a 50x slowdown seems worthy of attention.



@stroxler it’s good to hear that the update went smoothly! And thanks for mentioning Gc.quick_stat – I’ve just landed a fix to infer in anticipation of a soon-ish update to OCaml 5.0.

1 Like

Do you have some performance measurements to report?
I.e. if the program is parallel, how does it fares using domains instead of processes
and considering the number of cores your are using?