CI-based memory mesurement for PR

Some PR could cause the memory usage of the babylon.js engine, loaders, or other components.
Currently the CI only do tests, keeping the features and renderings correct, reviewers have to use snapshots to mesure memory affects manually.
So, could it be possible to make a CI-based memory mesurement, print or comment the memory usage change after this PR, for each components, making it easier for contributors and reviewers to check or mesure the memory affects.
It would be much better if other performance properties, like fps, cpu/gpu usage, load time, or things like that also mesured.

See also: arewefastyet

That’s an interesting suggestion.
We do have memory leak tests for simple scenes, but we don’t have memory usage. I will have to see if there are ways to be deterministic when measuring memory usage, because AFAIK whatever the browser itself offers is not.

I do have performance testing on the pipeline, which I hope to achieve by the release of 7.0.


There are performance.memory and measureUserAgentSpecificMemory() API for chromium-based browsers, and Page.metrics API for puppeteer.
Also, there seems to be the expose-gc command-line flag to make chromium-based browsers expose a gc method to trigger gc manually.
It seems hard to mesure gpu memory of webgl or webgpu in browser, maybe it’s possible to mesure the gpu memory of the process running this tab and the chrome gpu process at os level.
Hope this helps.

This is what I meant when I said it needs to be deterministic :slight_smile:
From tests I ran using any of those APIs, they are not very consistent. I am already exposing GC, as we need it for the memory leak testing.

I will continue looking into that, and will add it to the ongoing task to finalize perf tests in our CI.

1 Like