Skip to content

Performance Regression: GC.stat went from < 1s to ~50s in 4.14 -> 5.0 #11913

@stroxler

Description

@stroxler

When migrating to Ocaml 5.0.0, the Pyre team encountered a major slowdown in Gc.stat performance when we were type checking a large Python codebases. In that specific run it went from taking well under 1 second to about 50.

We moved the call - which was used for telemetry - behind a --debug flag as a mitigation:
facebook/pyre-check@91eba63

For our use case it turns out we could use Gc.quick_stat which is better, but it was still suggested in
https://discuss.ocaml.org/t/ocaml-5-0-0-in-pyre-mostly-smooth-sailing-gc-stat-regression/11205
that we file a ticket in case the magnitude of the slowdown comes as a surprise.

It appeared to me that when type-checking smaller codebases there was no visible regression, so I think that the ocaml process has to be using quite a bit of ram (likely several GB) before the problem appears. Unfortunately there is no open-source codebase I know of large enough to reproduce the slowdown inside of Pyre.

Metadata

Metadata

Assignees

Labels

PerformancePR or issues affecting runtime performance of the compiled programs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions