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

sql: fix erroneous benchmark regressions #117542

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

mgartner
Copy link
Collaborator

@mgartner mgartner commented Jan 9, 2024

Several benchmarks incorrectly included cluster shutdown as part of the
benchmark timing. This caused major regressions in benchmarks
when #117116 was merged because it made cluster shutdown slower. The
benchmarks now stop the timer before initiating cluster shutdown to more
accurately measure the code in question.

Fixes #117494

Release note: None

@mgartner mgartner requested a review from a team January 9, 2024 15:19
@mgartner mgartner requested review from a team as code owners January 9, 2024 15:19
@mgartner mgartner requested review from rharding6373 and removed request for a team January 9, 2024 15:19
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @mgartner and @rharding6373)


pkg/sql/opt/bench/fk_test.go line 54 at r1 (raw file):

			setup(b, r, cfg.setupFKs)
			b.ResetTimer()
			run(b, r)

i think it could be more clear to be explicit about when the timer is stopped. e.g.:

b.ResetTimer()
run(..)
b.StopTimer()

it's a little more resilient to the code being refactored. basically, we should always call StopTimer after the for ... i < b.N ... loop. (looks like most other benchmarks seem to do it this way)

Several benchmarks incorrectly included cluster shutdown as part of the
benchmark timing. This caused major regressions in benchmarks
when cockroachdb#117116 was merged because it made cluster shutdown slower. The
benchmarks now stop the timer before initiating cluster shutdown to more
accurately measure the code in question.

Fixes cockroachdb#117494

Release note: None
Copy link
Collaborator Author

@mgartner mgartner left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @rafiss and @rharding6373)


pkg/sql/opt/bench/fk_test.go line 54 at r1 (raw file):

Previously, rafiss (Rafi Shamim) wrote…

i think it could be more clear to be explicit about when the timer is stopped. e.g.:

b.ResetTimer()
run(..)
b.StopTimer()

it's a little more resilient to the code being refactored. basically, we should always call StopTimer after the for ... i < b.N ... loop. (looks like most other benchmarks seem to do it this way)

Good call. Done.

Copy link
Collaborator

@rharding6373 rharding6373 left a comment

Choose a reason for hiding this comment

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

:lgtm: Nice find.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @rafiss)

@mgartner
Copy link
Collaborator Author

TFTRs!

bors r+

@craig craig bot merged commit f428c19 into cockroachdb:master Jan 11, 2024
9 checks passed
@craig
Copy link
Contributor

craig bot commented Jan 11, 2024

Build succeeded:

@mgartner mgartner deleted the 117494-fix-benchmarks branch January 12, 2024 21:43
mgartner added a commit to mgartner/cockroach that referenced this pull request Jan 16, 2024
This commit fixes several benchmarks that incorrectly included cluster
shutdown as part of the benchmark timing. This caused major regressions.
See cockroachdb#117542 for more details.

Release note: None
craig bot pushed a commit that referenced this pull request Jan 16, 2024
117807: sql: fix benchmark regressions r=mgartner a=mgartner

This commit fixes several benchmarks that incorrectly included cluster
shutdown as part of the benchmark timing. This caused major regressions.
See #117542 for more details.

Epic: None

Release note: None


Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
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.

storage: enable EFOS, excise on snapshot, ingest splitting performance regressions
4 participants