BenchmarkDotNet
BenchmarkDotNet copied to clipboard
Add MemoryDiagnoser support for WASM
After https://github.com/dotnet/BenchmarkDotNet/pull/2227 is merged, the person working on it should remove these lines of code:
https://github.com/dotnet/BenchmarkDotNet/blob/183827cb0f12906faa7df9673bdb352d22fe2558/src/BenchmarkDotNet/Engines/GcStats.cs#L138-L140
and just test it by running the benchmarks for WASM. We more or less need to find out whether GC.GetTotalAllocatedBytes(precise: true) works on WASM:
https://github.com/dotnet/BenchmarkDotNet/blob/183827cb0f12906faa7df9673bdb352d22fe2558/src/BenchmarkDotNet/Engines/GcStats.cs#L151
If it does not, we should give GC.GetAllocatedBytesForCurrentThread() a try
For whoever works on this, you should follow the test setup done in WasmTests.
And we may want another memory diagnoser test for MonoAOTLLVM whenever we get integration tests for it (we're currently not checking against that toolchain like we are against wasm).