Repository navigation
cached ShardIds generated by HashCodeMessageExtractor - #5216
Merged
Aaronontheweb merged 1 commit intoAug 19, 2021
Merged
Aaronontheweb merged 1 commit into
Aaronontheweb merged 1 commit into
Conversation
Member
Author
|
Doesn't make a huge impact in the aggregate benchmarks, however: BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19041.1165 (2004/May2020Update/20H1)
AMD Ryzen 7 1700, 1 CPU, 16 logical and 8 physical cores
.NET SDK=5.0.302
[Host] : .NET Core 3.1.17 (CoreCLR 4.700.21.31506, CoreFX 4.700.21.31502), X64 RyuJIT
Job-MBAVSR : .NET Core 3.1.17 (CoreCLR 4.700.21.31506, CoreFX 4.700.21.31502), X64 RyuJIT
InvocationCount=1 UnrollFactor=1
|
Member
Author
|
Part of #5203 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since the number of possible shards is bounded at startup, we can avoid allocating a string each time we route a message by pre-calculating them in the constructor of the
HashCodeMessageExtractor.This improvement reduces all allocations and reduces latency by 50%.
Before
After