Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce allocation on StreamingHubClient broadcast events #787

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

mayuki
Copy link
Member

@mayuki mayuki commented Jun 14, 2024

Before

BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3737/23H2/2023Update/SunValley3)
13th Gen Intel Core i7-13700KF, 1 CPU, 24 logical and 16 physical cores
.NET SDK 8.0.300
  [Host]   : .NET 8.0.5 (8.0.524.21615), X64 RyuJIT AVX2
  ShortRun : .NET 8.0.5 (8.0.524.21615), X64 RyuJIT AVX2

Job=ShortRun  IterationCount=3  LaunchCount=1
WarmupCount=3

| Method                                     | Mean     | Error     | StdDev   | Rank | Gen0   | Gen1   | Gen2   | Allocated |
|------------------------------------------- |---------:|----------:|---------:|-----:|-------:|-------:|-------:|----------:|
| Parameter_Zero                             | 281.8 ns |  50.35 ns |  2.76 ns |    1 |      - |      - |      - |       4 B |
| Parameter_Many                             | 354.9 ns |  40.72 ns |  2.23 ns |    2 | 0.0029 | 0.0014 |      - |      47 B |
| Parameter_Zero_With_SynchronizationContext | 397.5 ns | 710.39 ns | 38.94 ns |    3 | 0.0057 | 0.0019 |      - |      97 B |
| Parameter_Many_With_SynchronizationContext | 420.9 ns | 251.29 ns | 13.77 ns |    4 | 0.0110 | 0.0048 | 0.0014 |     156 B |

After

BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3737/23H2/2023Update/SunValley3)
13th Gen Intel Core i7-13700KF, 1 CPU, 24 logical and 16 physical cores
.NET SDK 8.0.300
  [Host]   : .NET 8.0.5 (8.0.524.21615), X64 RyuJIT AVX2
  ShortRun : .NET 8.0.5 (8.0.524.21615), X64 RyuJIT AVX2

Job=ShortRun  IterationCount=3  LaunchCount=1
WarmupCount=3

| Method                                     | Mean     | Error     | StdDev   | Rank | Gen0   | Gen1   | Allocated |
|------------------------------------------- |---------:|----------:|---------:|-----:|-------:|-------:|----------:|
| Parameter_Zero                             | 256.8 ns |  57.96 ns |  3.18 ns |    1 |      - |      - |       2 B |
| Parameter_Many                             | 339.3 ns | 202.94 ns | 11.12 ns |    2 | 0.0029 | 0.0019 |      50 B |
| Parameter_Zero_With_SynchronizationContext | 372.1 ns | 209.20 ns | 11.47 ns |    3 | 0.0029 | 0.0010 |      49 B |
| Parameter_Many_With_SynchronizationContext | 372.8 ns | 192.16 ns | 10.53 ns |    3 | 0.0057 | 0.0010 |      91 B |

@mayuki mayuki merged commit 49b57ee into vNext Jun 14, 2024
3 checks passed
@mayuki mayuki deleted the feature/ReduceBroadcastAllocationOnClient branch June 14, 2024 07:23
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.

1 participant