ocaml / ocaml

The core OCaml system: compilers, runtime system, base libraries
https://ocaml.org
Other
5.19k stars 1.06k forks source link

Improve robustness of statmemprof testsuite #13107

Closed stedolan closed 3 weeks ago

stedolan commented 3 weeks ago

When porting statmemprof to the flambda2 branch, I noticed a few places where the current testsuite is relying on details of the compiler that are not particularly stable (whether certain functions are inlined, how much CSE occurs, etc.). So, this PR contains a few tweaks to the statmemprof testsuite to try to make it more independent of these details.

The last of these (the moved_while_blocking workaround) also makes a small change to the runtime, to remove an unnecessary allocation in bytecode that the testsuite was picking up and working around. (This change only affects bytecode, since native code already avoided the allocation through a different means)

cc @NickBarnes

NickBarnes commented 3 weeks ago

This is obviously all great.