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

Add inlining annotations in dec2flt. #108717

Merged
merged 3 commits into from
Mar 21, 2023
Merged

Conversation

TDecking
Copy link
Contributor

@TDecking TDecking commented Mar 3, 2023

Currently, the combination of dec2flt being generic and the FromStr implementaions
containing inline anttributes causes massive amounts of assembly to be generated whenever
these implementation are used. In addition, the assembly has calls to function which ought to
be inlined, but they are not (even when using lto).

This Pr fixes this.

@rustbot
Copy link
Collaborator

rustbot commented Mar 3, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @thomcc (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@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 Mar 3, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 3, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rustbot
Copy link
Collaborator

rustbot commented Mar 3, 2023

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@thomcc
Copy link
Member

thomcc commented Mar 4, 2023

@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 Mar 4, 2023
@bors
Copy link
Contributor

bors commented Mar 4, 2023

⌛ Trying commit db2c6e0 with merge aad4a39ef47c618aa71a055c8699e94f5fbf9959...

@bors
Copy link
Contributor

bors commented Mar 4, 2023

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

1 similar comment
@bors
Copy link
Contributor

bors commented Mar 4, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (aad4a39ef47c618aa71a055c8699e94f5fbf9959): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@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.3% [0.3%, 0.4%] 6
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.8% [-1.4%, -0.4%] 5
Improvements ✅
(secondary)
-0.2% [-0.2%, -0.2%] 1
All ❌✅ (primary) -0.2% [-1.4%, 0.4%] 11

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)
3.8% [3.1%, 4.5%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.4% [-4.8%, -0.1%] 2
Improvements ✅
(secondary)
-2.8% [-2.8%, -2.8%] 1
All ❌✅ (primary) 0.7% [-4.8%, 4.5%] 4

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

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Mar 4, 2023
@TDecking
Copy link
Contributor Author

TDecking commented Mar 4, 2023

All regressions are inside diesel-1.4.8. The only instance I see is in sqlite/types/date_and_time/chrono.rs inside the
impl FromSql<Timestamp, Sqlite> for NaiveDateTime definition. Oddly enough, there is a regression inside the check profile,
and I don't see how my changes could possibly affect this.

@Noratrieb
Copy link
Member

Running the cachegrind command locally shows that most changes in diesel happened in type folding - looks like noise.
@rustbot label +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Mar 11, 2023
@TDecking
Copy link
Contributor Author

@Nilstrieb Thanks for the help.

@thomcc
Copy link
Member

thomcc commented Mar 21, 2023

@bors r+

@bors
Copy link
Contributor

bors commented Mar 21, 2023

📌 Commit db2c6e0 has been approved by thomcc

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 Mar 21, 2023
@bors
Copy link
Contributor

bors commented Mar 21, 2023

⌛ Testing commit db2c6e0 with merge 84c47b8...

@bors
Copy link
Contributor

bors commented Mar 21, 2023

☀️ Test successful - checks-actions
Approved by: thomcc
Pushing 84c47b8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Mar 21, 2023
@bors bors merged commit 84c47b8 into rust-lang:master Mar 21, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 21, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (84c47b8): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -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.3% [0.3%, 0.3%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.6% [-0.6%, -0.6%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-0.6%, 0.3%] 2

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)
1.6% [0.5%, 4.4%] 4
Regressions ❌
(secondary)
2.5% [2.5%, 2.5%] 1
Improvements ✅
(primary)
-1.5% [-1.9%, -1.1%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.5% [-1.9%, 4.4%] 6

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression-triaged The performance regression has been triaged. 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