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

[aggregator] Avoid large copies in entry rollup comparisons #3185

Closed
wants to merge 1 commit into from

Conversation

vdarulis
Copy link
Collaborator

@vdarulis vdarulis commented Feb 7, 2021

What this PR does / why we need it:

The heavy copy takes up approx 30% of the time in both profiles and benchmarks, which is totally unnecessary.

name                  old time/op    new time/op    delta
AggregationValues-12     108ns ± 3%      76ns ± 0%  -29.35%  (p=0.008 n=5+5)

name                  old alloc/op   new alloc/op   delta
AggregationValues-12     0.00B          0.00B          ~     (all equal)

name                  old allocs/op  new allocs/op  delta
AggregationValues-12      0.00           0.00          ~     (all equal)

Special notes for your reviewer:

Does this PR introduce a user-facing and/or backwards incompatible change?:


Does this PR require updating code package or user-facing documentation?:


@vdarulis vdarulis changed the title V/time [aggregator] Avoid large copies in entry rollup comparisons Feb 7, 2021
@robskillington
Copy link
Collaborator

Will this cause any new heap allocations due to escape analysis not able to see if ptr is held onto from a function called down the stack? go build -gcflags="-m" should be able to show or not I believe.

@vdarulis vdarulis marked this pull request as draft February 7, 2021 08:24
@vdarulis
Copy link
Collaborator Author

vdarulis commented Feb 9, 2021

Will this cause any new heap allocations due to escape analysis not able to see if ptr is held onto from a function called down the stack? go build -gcflags="-m" should be able to show or not I believe.

@robskillington it did not, but in the end went for a different approach, as the root cause of all these copies is Go inlining, or rather lack of it - dropping this in favor of #3195, which does not change semantics and is actually even faster.

@vdarulis vdarulis closed this Feb 9, 2021
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.

2 participants