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

Display walltime benchmarks with subnanosecond precision #124774

Merged
merged 3 commits into from
May 10, 2024

Conversation

the8472
Copy link
Member

@the8472 the8472 commented May 5, 2024

With modern CPUs running at more than one cycle per nanosecond the current precision is insufficient to resolve differences worth several cycles per iteration.

Granted, walltime benchmarks often are noisy but occasionally, especially when no allocations are involved, the difference really is just a few cycles.

example results when benchmarking 1-4 serialized ADD instructions and an empty bench body

running 4 tests
test add  ... bench:           0.24 ns/iter (+/- 0.00)
test add2 ... bench:           0.48 ns/iter (+/- 0.01)
test add3 ... bench:           0.72 ns/iter (+/- 0.01)
test add4 ... bench:           0.96 ns/iter (+/- 0.01)
test empty ... bench:           0.24 ns/iter (+/- 0.00)

@rustbot
Copy link
Collaborator

rustbot commented May 5, 2024

r? @jhpratt

rustbot has assigned @jhpratt.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 5, 2024
@the8472 the8472 added the A-libtest Area: #[test] related label May 5, 2024
@rust-log-analyzer

This comment has been minimized.

example results when benchmarking 1-4 serialized ADD instructions

```
running 4 tests
test add  ... bench:           0.24 ns/iter (+/- 0.00)
test add2 ... bench:           0.48 ns/iter (+/- 0.01)
test add3 ... bench:           0.72 ns/iter (+/- 0.01)
test add4 ... bench:           0.96 ns/iter (+/- 0.01)
```
@rustbot
Copy link
Collaborator

rustbot commented May 5, 2024

Some changes occurred in run-make tests.

cc @jieyouxu

@jhpratt
Copy link
Member

jhpratt commented May 5, 2024

Do you know if there's a reason that it's always calculated in nanoseconds? Being most familiar with criterion (as are many others), I suspect that displaying ms, µs, ns, and ps as appropriate is reasonable.

@the8472
Copy link
Member Author

the8472 commented May 6, 2024

Switching units when doing a before/after comparison would makes thing more difficult to eyeball.

@jhpratt
Copy link
Member

jhpratt commented May 9, 2024

@bors r+

@bors
Copy link
Contributor

bors commented May 9, 2024

📌 Commit 2a7c42f has been approved by jhpratt

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 9, 2024
@bors
Copy link
Contributor

bors commented May 10, 2024

⌛ Testing commit 2a7c42f with merge e93f342...

@bors
Copy link
Contributor

bors commented May 10, 2024

☀️ Test successful - checks-actions
Approved by: jhpratt
Pushing e93f342 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label May 10, 2024
@bors bors merged commit e93f342 into rust-lang:master May 10, 2024
7 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 10, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e93f342): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.7% [-2.7%, -2.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -2.7% [-2.7%, -2.7%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 674.951s -> 674.435s (-0.08%)
Artifact size: 315.92 MiB -> 315.80 MiB (-0.04%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-libtest Area: #[test] related merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants