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

util/growstack: increase stack growth for 1.19 #88187

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

ajwerner
Copy link
Contributor

Now that we've adopted go 1.19, we notice that the performance is much worse (~8%) than we observed in go 1.18. Interestingly, we observe in profiles that we spend a lot more time increasing our stack size underneath request evaluation. This implied to me that some part of this is probably due to the runtime's new stack growth behavior. Perhaps what is going on is that the initial stacks are now smaller than they used to be so when we grow it, we grow it by less than we need to. I ran a benchmark that seems to indicate that this theory is true. I'd like to merge this to master and then backport it after we collect some more data.

We never released this, so no note.

Touches #88038

Release note: None

Now that we've adopted go 1.19, we notice that the performance is much worse
(~8%) than we observed in go 1.18. Interestingly, we observe in profiles that
we spend a lot more time increasing our stack size underneath request
evaluation. This implied to me that some part of this is probably due to the
runtime's new stack growth behavior. Perhaps what is going on is that the
initial stacks are now smaller than they used to be so when we grow it, we grow
it by less than we need to. I ran a benchmark that seems to indicate that this
theory is true. I'd like to merge this to master and then backport it after we
collect some more data.

We never released this, so no note.

Touches cockroachdb#88038

Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@ajwerner
Copy link
Contributor Author

I'm running a benchmark, I'll report the results when it finishes.

@ajwerner
Copy link
Contributor Author

name             old ops/s   new ops/s   delta
KV95-throughput  16.4k ± 3%  17.5k ± 1%   ~     (p=0.100 n=3+3)

name             old ms/s    new ms/s    delta
KV95-P50          4.80 ± 4%   4.50 ± 0%   ~     (p=0.100 n=3+3)
KV95-Avg          1.60 ± 0%   1.50 ± 0%   ~     (p=0.100 n=3+3)

I'm pretty sure this is it. The profiles showed a clear difference and the difference in throughput here with this configuration is undeniable.

The benchmark was https://gist.github.com/ajwerner/43e8b48645a9ade337d7cd654a58de0e with
./run_benchmark.sh -b ./cockroach-without -a ./cockroach-with -c ajwerner-test -d 120s -f 60s -p 32 -s 32 -n 3 run on 4-core VMs

@ajwerner ajwerner marked this pull request as ready for review September 19, 2022 22:28
@ajwerner
Copy link
Contributor Author

TFTR!

bors r=nvanbenschoten

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)


pkg/util/growstack/growstack.s line 13 at r1 (raw file):

#include "funcdata.h"

TEXT ·Grow(SB),0,$32768-0

nit: we should adjust the comments in growstack.go according to the new 32KiB value.

@ajwerner
Copy link
Contributor Author

I'll do it in the backport and another PR

@craig
Copy link
Contributor

craig bot commented Sep 20, 2022

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Sep 20, 2022

Build succeeded:

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.

4 participants