BenchmarkDotNet icon indicating copy to clipboard operation
BenchmarkDotNet copied to clipboard

Add MemoryDiagnoser support for WASM

Open adamsitnik opened this issue 2 years ago • 1 comments
trafficstars

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

adamsitnik avatar Dec 09 '22 10:12 adamsitnik

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).

timcassell avatar Apr 24 '24 02:04 timcassell