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

Inline trivial (noop) flush calls #114194

Merged
merged 1 commit into from
Aug 11, 2023
Merged

Inline trivial (noop) flush calls #114194

merged 1 commit into from
Aug 11, 2023

Conversation

thomcc
Copy link
Member

@thomcc thomcc commented Jul 29, 2023

At work I noticed that writer.flush()? didn't get optimized away in cases where the flush is obviously a no-op, which I had expected (well, desired).

I went through and added #[inline] to a bunch of cases that were obviously noops, or delegated to ones that were obviously noops. I omitted platforms I don't have access to (some tier3). I didn't do this very scientifically, in cases where it was non-obvious I left #[inline] off.

@rustbot
Copy link
Collaborator

rustbot commented Jul 29, 2023

r? @cuviper

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 29, 2023
@thomcc
Copy link
Member Author

thomcc commented Jul 29, 2023

It's always a little dodgy to add a bunch of inline on widely used types, so...

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 29, 2023
@bors
Copy link
Contributor

bors commented Jul 29, 2023

⌛ Trying commit 558f49d with merge 0c26b4912c0a4aa39d8f4a8600506e9d2b87e86f...

@bors
Copy link
Contributor

bors commented Jul 29, 2023

☀️ Try build successful - checks-actions
Build commit: 0c26b4912c0a4aa39d8f4a8600506e9d2b87e86f (0c26b4912c0a4aa39d8f4a8600506e9d2b87e86f)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0c26b4912c0a4aa39d8f4a8600506e9d2b87e86f): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

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

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)
4.5% [4.5%, 4.5%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.9% [-1.9%, -1.9%] 1
All ❌✅ (primary) 4.5% [4.5%, 4.5%] 1

Cycles

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.7% [0.7%, 0.7%] 1
Regressions ❌
(secondary)
3.1% [3.1%, 3.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.7% [0.7%, 0.7%] 1

Binary size

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)
-0.0% [-0.0%, -0.0%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.0% [-0.0%, -0.0%] 3

Bootstrap: 649.942s -> 651.104s (0.18%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 29, 2023
@workingjubilee
Copy link
Member

fmt-write-str with a 69.69 significance factor on its cycles

nice.
too bad these benches are hugely noisy and we don't really have good metrics (or indeed a history of stats to compare against) yet.

@thomcc
Copy link
Member Author

thomcc commented Jul 31, 2023

Yeah it's very hard to say if that's noise or not. It could go either way.

@cuviper
Copy link
Member

cuviper commented Aug 11, 2023

LGTM!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 11, 2023

📌 Commit 558f49d has been approved by cuviper

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 Aug 11, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 11, 2023
…mpiler-errors

Rollup of 5 pull requests

Successful merges:

 - rust-lang#114194 (Inline trivial (noop) flush calls)
 - rust-lang#114257 (Avoid using `ptr::Unique` in `LinkedList` code)
 - rust-lang#114359 ([library/std] Replace condv while loop with `cvar.wait_while`.)
 - rust-lang#114402 (Fix documentation of impl From<Vec<T>> for Rc<[T]>)
 - rust-lang#114715 (Revert clippy lint [`filter_map_bool_then`])

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0c241e6 into rust-lang:master Aug 11, 2023
@rustbot rustbot added this to the 1.73.0 milestone Aug 11, 2023
@bors
Copy link
Contributor

bors commented Aug 11, 2023

⌛ Testing commit 558f49d with merge 7d8386f...

flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 14, 2023
…mpiler-errors

Rollup of 5 pull requests

Successful merges:

 - rust-lang#114194 (Inline trivial (noop) flush calls)
 - rust-lang#114257 (Avoid using `ptr::Unique` in `LinkedList` code)
 - rust-lang#114359 ([library/std] Replace condv while loop with `cvar.wait_while`.)
 - rust-lang#114402 (Fix documentation of impl From<Vec<T>> for Rc<[T]>)
 - rust-lang#114715 (Revert clippy lint [`filter_map_bool_then`])

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

6 participants