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

server: reduce allocations in setupSpanForIncomingRPC #76174

Conversation

andreimatei
Copy link
Contributor

A couple of variables were independently escaping because they were
captured by a closure. This patch groups them into a single allocation,
saving two allocations per call.

name old time/op new time/op delta
SetupSpanForIncomingRPC-32 508ns ± 2% 442ns ± 0% -12.91% (p=0.008 n=5+5)
name old alloc/op new alloc/op delta
SetupSpanForIncomingRPC-32 178B ± 0% 145B ± 0% -18.54% (p=0.008 n=5+5)
name old allocs/op new allocs/op delta
SetupSpanForIncomingRPC-32 4.00 ± 0% 2.00 ± 0% -50.00% (p=0.008 n=5+5)

Release note: None

@andreimatei andreimatei requested review from abarganier and a team February 7, 2022 17:25
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@andreimatei andreimatei force-pushed the tracing.setupSpanForIncomingRPC-reduce-allocs branch 2 times, most recently from 1a3702a to 6e0efa0 Compare February 7, 2022 21:45
Copy link
Contributor

@abarganier abarganier left a comment

Choose a reason for hiding this comment

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

:lgtm: once merge conflict is fixed.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

@andreimatei andreimatei force-pushed the tracing.setupSpanForIncomingRPC-reduce-allocs branch from 6e0efa0 to b6442b2 Compare February 9, 2022 18:10
Copy link
Contributor Author

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

TFTR!

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@craig
Copy link
Contributor

craig bot commented Feb 9, 2022

Build failed (retrying...):

@andreimatei
Copy link
Contributor Author

bors r-

merge skew

@craig
Copy link
Contributor

craig bot commented Feb 9, 2022

Canceled.

A couple of variables were independently escaping because they were
captured by a closure. This patch groups them into a single allocation,
saving two allocations per call.

name                        old time/op    new time/op    delta
SetupSpanForIncomingRPC-32     508ns ± 2%     442ns ± 0%  -12.91%  (p=0.008 n=5+5)
name                        old alloc/op   new alloc/op   delta
SetupSpanForIncomingRPC-32      178B ± 0%      145B ± 0%  -18.54%  (p=0.008 n=5+5)
name                        old allocs/op  new allocs/op  delta
SetupSpanForIncomingRPC-32      4.00 ± 0%      2.00 ± 0%  -50.00%  (p=0.008 n=5+5)

Release note: None
@andreimatei andreimatei force-pushed the tracing.setupSpanForIncomingRPC-reduce-allocs branch from b6442b2 to c6ec6eb Compare February 9, 2022 18:54
Copy link
Contributor Author

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale)

@craig
Copy link
Contributor

craig bot commented Feb 9, 2022

This PR was included in a batch that was canceled, it will be automatically retried

@craig craig bot merged commit 0fdf716 into cockroachdb:master Feb 10, 2022
@craig
Copy link
Contributor

craig bot commented Feb 10, 2022

Build succeeded:

@andreimatei andreimatei deleted the tracing.setupSpanForIncomingRPC-reduce-allocs branch February 10, 2022 22:18
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