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 `try_get`. #50931

Merged
merged 1 commit into from May 22, 2018
Merged

Inline `try_get`. #50931

merged 1 commit into from May 22, 2018

Conversation

@nnethercote
Copy link
Contributor

@nnethercote nnethercote commented May 21, 2018

This speeds up lots of rustc-perf benchmark runs. The maximum
improvement is 1%, but there are a lot in the 0.5--1.0% range.

This speeds up lots of rustc-perf benchmark runs. The maximum
improvement is 1%, but there are a lot in the 0.5--1.0% range.
@rust-highfive
Copy link
Collaborator

@rust-highfive rust-highfive commented May 21, 2018

r? @michaelwoerister

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

@@ -105,6 +105,10 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
/// start executing the query, or it returns with the result of the query.
/// If the query is executing elsewhere, this will wait for it.
/// If the query panicked, this will silently panic.
///
/// This function is inlined because that results in a noticeable speedup

This comment has been minimized.

@ishitatsuyuki

ishitatsuyuki May 21, 2018
Contributor

Nit: can/should we use normal comments here? This doesn't seem useful when shown in rustdoc.

@michaelwoerister
Copy link
Contributor

@michaelwoerister michaelwoerister commented May 21, 2018

@bors r+

@bors
Copy link
Contributor

@bors bors commented May 21, 2018

📌 Commit 9512016 has been approved by michaelwoerister

@Mark-Simulacrum
Copy link
Member

@Mark-Simulacrum Mark-Simulacrum commented May 21, 2018

@bors rollup

kennytm added a commit to kennytm/rust that referenced this pull request May 22, 2018
…elwoerister

Inline `try_get`.

This speeds up lots of rustc-perf benchmark runs. The maximum
improvement is 1%, but there are a lot in the 0.5--1.0% range.
bors added a commit that referenced this pull request May 22, 2018
Rollup of 15 pull requests

Successful merges:

 - #50846 (Add E0665)
 - #50849 (CheckLoopVisitor: also visit closure arguments)
 - #50863 (Make `[T]::len` and `str::len` const fn)
 - #50875 (rustdoc: use "short form" doc(cfg) printing even when combined with other conditionals)
 - #50913 (Fix typo in cell.rs)
 - #50914 (Issue #50636: Improve error diagnostic with missing commas after struct fields.)
 - #50931 (Inline `try_get`.)
 - #50932 (Optimize seen Predicate filtering.)
 - #50945 (Stabilize feature from_ref)
 - #50946 (rustc: Fix procedural macros generating lifetime tokens)
 - #50947 (rustdoc: set tab width in rust source blocks)
 - #50952 (Add the 2018 edition of the book to doc.rust-lang.org)
 - #50958 (Micro-optimization on PR#50697)
 - #50961 (Fix FileCheck finding with MSVC)
 - #50963 (Right-size the `VecDeque` in `coerce_unsized`.)

Failed merges:
@bors bors merged commit 9512016 into rust-lang:master May 22, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@nnethercote nnethercote deleted the nnethercote:inline-try_get branch May 23, 2018
Shnatsel referenced this pull request in image-rs/image May 28, 2020
The intention here is to help the optimizer. For methods where access
out-of-bounds is not fatal the bounds checking code appears to be
repeated unnecessarily in many cases—once for a manual check to avoid
the panic and once in the impl in the path that would lead to such
panic.

This is backwards compatible in that the new methods are default
implemented on the traits. In the long term it seems nevertheless
advisable to flip this around and default implement the panicking method
instead. This would also improve possibilities for indexing and
adherence to the API guidelines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.