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

perf: improve LocalTraceIdentifier performance #7118

Merged
merged 6 commits into from
Feb 14, 2024

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Feb 14, 2024

I think we still want this. cc @klkvr

Implementation modified from #7105,
see that PR for more information.

I modified it to use binary search on the sorted id array to find the minimum index, then iterating starting from that point instead of filtering which would search the entire array.

See main thread performance in the following profiles:

Implementation modified from #7105,
see that PR for more information.

Co-authored-by: Arsenii Kulikov <klkvrr@gmail.com>
@DaniPopes DaniPopes requested a review from klkvr February 14, 2024 03:50
@DaniPopes DaniPopes requested a review from klkvr February 14, 2024 05:09
@DaniPopes
Copy link
Member Author

DaniPopes commented Feb 14, 2024

Updated to start searching at equal code length for the super majority case because otherwise we're searching len*0.9 .. len with a very low chance of finding a match on every call.

@DaniPopes DaniPopes force-pushed the dani/perf-localidentifier branch from 377a75c to 0e466ca Compare February 14, 2024 05:13
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

diff score 👍

@DaniPopes DaniPopes merged commit 73383b5 into master Feb 14, 2024
20 checks passed
@DaniPopes DaniPopes deleted the dani/perf-localidentifier branch February 14, 2024 22:28
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