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
eliminate Lazy<string>
from Address
#5068
Merged
Aaronontheweb
merged 1 commit into
akkadotnet:dev
from
Aaronontheweb:perf/Address-memory
Jun 3, 2021
Merged
eliminate Lazy<string>
from Address
#5068
Aaronontheweb
merged 1 commit into
akkadotnet:dev
from
Aaronontheweb:perf/Address-memory
Jun 3, 2021
Conversation
This file contains 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
Aaronontheweb
changed the title
eliminate Lazy<string> from
eliminate Jun 3, 2021
Address
Lazy<string>
from Address
|
Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|
ActorPath_Parse | 583.49 ns | 11.631 ns | 16.305 ns | 0.1392 | - | - | 584 B |
ActorPath_Concat | 55.87 ns | 1.142 ns | 1.315 ns | 0.0268 | - | - | 112 B |
ActorPath_Equals | 20.35 ns | 0.336 ns | 0.314 ns | - | - | - | - |
ActorPath_ToString | 207.66 ns | 4.186 ns | 3.916 ns | 0.0515 | - | - | 216 B |
ActorPath_ToSerializationFormat | 225.86 ns | 2.761 ns | 2.583 ns | 0.0515 | - | - | 216 B |
ActorPath_ToSerializationFormatWithAddress | 244.88 ns | 4.940 ns | 4.379 ns | 0.0515 | - | - | 216 B |
After
BenchmarkDotNet=v0.13.0, OS=Windows 10.0.19041.985 (2004/May2020Update/20H1)
AMD Ryzen 7 1700, 1 CPU, 16 logical and 8 physical cores
.NET SDK=5.0.203
[Host] : .NET Core 3.1.15 (CoreCLR 4.700.21.21202, CoreFX 4.700.21.21402), X64 RyuJIT
DefaultJob : .NET Core 3.1.15 (CoreCLR 4.700.21.21202, CoreFX 4.700.21.21402), X64 RyuJIT
Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|
ActorPath_Parse | 526.80 ns | 8.282 ns | 7.342 ns | 0.1068 | - | - | 448 B |
ActorPath_Concat | 58.06 ns | 1.214 ns | 1.399 ns | 0.0267 | - | - | 112 B |
ActorPath_Equals | 20.66 ns | 0.400 ns | 0.374 ns | - | - | - | - |
ActorPath_ToString | 210.67 ns | 4.207 ns | 5.616 ns | 0.0515 | - | - | 216 B |
ActorPath_ToSerializationFormat | 232.91 ns | 4.497 ns | 4.998 ns | 0.0515 | - | - | 216 B |
ActorPath_ToSerializationFormatWithAddress | 246.31 ns | 4.979 ns | 7.140 ns | 0.0515 | - | - | 216 B |
Address
Performance
Before
BenchmarkDotNet=v0.13.0, OS=Windows 10.0.19041.985 (2004/May2020Update/20H1)
AMD Ryzen 7 1700, 1 CPU, 16 logical and 8 physical cores
.NET SDK=5.0.203
[Host] : .NET Core 3.1.15 (CoreCLR 4.700.21.21202, CoreFX 4.700.21.21402), X64 RyuJIT
DefaultJob : .NET Core 3.1.15 (CoreCLR 4.700.21.21202, CoreFX 4.700.21.21402), X64 RyuJIT
Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|
Address_Parse | 1,440.3613 ns | 8.8500 ns | 7.8453 ns | 0.1354 | - | - | 568 B |
Address_CompareTo | 16.5944 ns | 0.1334 ns | 0.1247 ns | - | - | - | - |
Address_ToString | 0.6547 ns | 0.0500 ns | 0.0443 ns | - | - | - | - |
Address_Equals | 7.9953 ns | 0.1255 ns | 0.1174 ns | - | - | - | - |
Address_GetHashCode | 34.5831 ns | 0.3759 ns | 0.3516 ns | - | - | - | - |
After
BenchmarkDotNet=v0.13.0, OS=Windows 10.0.19041.985 (2004/May2020Update/20H1)
AMD Ryzen 7 1700, 1 CPU, 16 logical and 8 physical cores
.NET SDK=5.0.203
[Host] : .NET Core 3.1.15 (CoreCLR 4.700.21.21202, CoreFX 4.700.21.21402), X64 RyuJIT
DefaultJob : .NET Core 3.1.15 (CoreCLR 4.700.21.21202, CoreFX 4.700.21.21402), X64 RyuJIT
Method | Mean | Error | StdDev | Gen 0 | Gen 1 | Gen 2 | Allocated |
---|---|---|---|---|---|---|---|
Address_Parse | 1,368.8126 ns | 9.9937 ns | 8.8591 ns | 0.1030 | - | - | 432 B |
Address_CompareTo | 17.3290 ns | 0.1720 ns | 0.1609 ns | - | - | - | - |
Address_ToString | 0.6843 ns | 0.0619 ns | 0.0549 ns | - | - | - | - |
Address_Equals | 7.4430 ns | 0.1869 ns | 0.1836 ns | - | - | - | - |
Address_GetHashCode | 34.9871 ns | 0.3221 ns | 0.3013 ns | - | - | - | - |
This optimization might actually hurt memory footprint in use cases where there are a lot of actors and address ToString() are never called. |
Oh, I didn't notice the changes on the ToString() method, yes, this is good. |
Arkatufus
approved these changes
Jun 3, 2021
This was referenced Jun 16, 2021
Merged
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.
This PR:
ActorPath.Parse
performanceAddress
memory allocation