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

Speed up equals method on ImmutableOpenMap #90758

Conversation

original-brownbear
Copy link
Member

This method is somewhat hot during CS diffing at times, we can speed it up a little by taking the pointless indirection of the conversion iterator out of things and saving the allocations from it.

relates #77466

This method is somewhat hot during CS diffing at times,
we can speed it up a little by taking the pointless indirection
of the conversion iterator out of things and saving the allocations
from it.
@original-brownbear original-brownbear added >non-issue :Core/Infra/Core Core issues without another label v8.6.0 labels Oct 10, 2022
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Oct 10, 2022
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@thecoop
Copy link
Member

thecoop commented Oct 10, 2022

What sort of perf bump do we get from this?

@original-brownbear
Copy link
Member Author

What sort of perf bump do we get from this?

Hard to put a clean measurement on this. Not a massive amount in terms of runtime but two nice things come out of this:

  1. This saves ~1% of all object allocations in the many-shards snapshot benchmark which isn't nothing and saves CPU indirectly
  2. This seems to make map equals on other maps faster in some diff spots by apparently removing some metamorphic call sites in AbstractMap

I mostly care about the first point, taking a little of the GC noise out of things.

Copy link
Member

@thecoop thecoop left a comment

Choose a reason for hiding this comment

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

Fair enough, LGTM

@original-brownbear
Copy link
Member Author

Thanks Simon!

@original-brownbear original-brownbear merged commit d2dc747 into elastic:main Oct 10, 2022
@original-brownbear original-brownbear deleted the faster-equals-immutable-open-map branch October 10, 2022 19:27
@original-brownbear original-brownbear restored the faster-equals-immutable-open-map branch November 30, 2024 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Core Core issues without another label >non-issue Team:Core/Infra Meta label for core/infra team v8.6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants