Skip to content

Enable MemoryDiagnoser on Legacy Mono - #2459

Merged
timcassell merged 8 commits into
dotnet:masterfrom
MichalPetryka:patch-3
Nov 15, 2023
Merged

timcassell merged 8 commits into
dotnet:masterfrom
MichalPetryka:patch-3

Conversation

@MichalPetryka

@MichalPetryka MichalPetryka commented Nov 2, 2023

Copy link
Copy Markdown
Contributor

This enables MemoryDiagnoser on Legacy Mono (since it provides GetAllocatedBytesForCurrentThread) and makes it more resilient to errors.

This enables MemoryDiagnoser on Legacy Mono and makes it more resilient to errors.
@MichalPetryka
MichalPetryka marked this pull request as draft November 2, 2023 01:54
Comment thread src/BenchmarkDotNet/Engines/GcStats.cs Outdated
Comment thread src/BenchmarkDotNet/Engines/GcStats.cs
Comment thread src/BenchmarkDotNet/Engines/GcStats.cs Outdated
Co-authored-by: Tim Cassell <35501420+timcassell@users.noreply.github.com>
@timcassell

Copy link
Copy Markdown
Collaborator

@MichalPetryka Is this good to go? It's still in draft.

@MichalPetryka
MichalPetryka marked this pull request as ready for review November 15, 2023 21:13
@MichalPetryka

Copy link
Copy Markdown
Contributor Author

Is this good to go?

I wanted to check with a test benchmark and forgot about it, it seems to work fine:

| Method | Job                | Runtime            | Mean      | Error     | StdDev    | Gen0   | Allocated |
|------- |------------------- |------------------- |----------:|----------:|----------:|-------:|----------:|
| Alloc  | .NET 8.0           | .NET 8.0           | 11.401 ns | 1.2076 ns | 3.5605 ns | 0.0255 |      40 B |
| Alloc  | .NET Framework 4.8 | .NET Framework 4.8 |  6.179 ns | 0.6341 ns | 1.8597 ns | 0.0255 |      40 B |
| Alloc  | Mono               | Mono               | 16.793 ns | 1.1951 ns | 3.5238 ns | 0.0115 |      48 B |
| Alloc  | Mono with .NET 8.0 | Mono with .NET 8.0 | 18.935 ns | 0.3219 ns | 0.3832 ns | 0.0115 |      48 B |

@timcassell

Copy link
Copy Markdown
Collaborator

Yep, I tested it with my own benchmarks also, and it all seems good to me. Thanks @MichalPetryka!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants