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

(squash/update of #909) Read message type from fix string without regex #910

Merged

Conversation

gbirchmeier
Copy link
Member

@gbirchmeier gbirchmeier commented Dec 17, 2024

closes #909 -- this PR is the same content, squashed into one commit, plus release notes and a little cleanup

attn @jkulubya

Original description from #909:

I'm investigating how to have the message type as part of the log's context when a message is sent/received in #899, and that might require calling GetMsgType on the hot path. This pr removes the regex from that method, in case that's the way forward.

BenchmarkDotNet v0.14.0, NixOS 24.11 (Vicuna)
    11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
    .NET SDK 8.0.307
      [Host]     : .NET 8.0.11 (8.0.1124.51707), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
      DefaultJob : .NET 8.0.11 (8.0.1124.51707), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI

    | Method | Mean      | Error    | StdDev    | Gen0   | Allocated |
    |------- |----------:|---------:|----------:|-------:|----------:|
    | Manual |  35.33 ns | 2.754 ns |  8.122 ns | 0.0038 |      24 B |
    | Regex  | 322.38 ns | 9.405 ns | 25.265 ns | 0.0648 |     408 B |

Manual is this PR, Regex is current code.

@gbirchmeier gbirchmeier force-pushed the rebase-909-msg-type-without-regex branch from e73ae6c to 7521b48 Compare December 17, 2024 20:48
@gbirchmeier
Copy link
Member Author

Whatever happens with #899, this PR is great regardless because of the obvious performance gain. Thanks @jkulubya !

BenchmarkDotNet v0.14.0, NixOS 24.11 (Vicuna)
    11th Gen Intel Core i7-1165G7 2.80GHz, 1 CPU, 8 logical and 4 physical cores
    .NET SDK 8.0.307
      [Host]     : .NET 8.0.11 (8.0.1124.51707), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI
      DefaultJob : .NET 8.0.11 (8.0.1124.51707), X64 RyuJIT AVX-512F+CD+BW+DQ+VL+VBMI

    | Method | Mean      | Error    | StdDev    | Gen0   | Allocated |
    |------- |----------:|---------:|----------:|-------:|----------:|
    | Manual |  35.33 ns | 2.754 ns |  8.122 ns | 0.0038 |      24 B |
    | Regex  | 322.38 ns | 9.405 ns | 25.265 ns | 0.0648 |     408 B |
@gbirchmeier gbirchmeier force-pushed the rebase-909-msg-type-without-regex branch from 7521b48 to ee47ce9 Compare December 17, 2024 20:51
@gbirchmeier gbirchmeier merged commit 2a27d6e into connamara:master Dec 17, 2024
2 checks passed
@gbirchmeier gbirchmeier deleted the rebase-909-msg-type-without-regex branch December 17, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants