-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Optimize relocation counting in DehydratedDataNode.GetData #103202
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas |
I think there's a bug in the code. The changed profile is not a coincidence. |
I re-run the code twice, checking that the results of the original and new code are identical. There were no diffs. Re-running the profiler produces this:
Must have been some profiler fluke. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Save a couple of duplicate dictionary lookups. Thanks @MihaZupan for the idea.
Profile before:
Profile after:
The actual saving is around 4.2s or 70+% of the method runtime (
TryInsert
+FindValue
vs.GetValueRefOrAddDefault
). It seems it just happened to hit a GC in the second profile.