Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Inline `try_get`. #50931
Inline `try_get`. #50931
Conversation
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 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 | |||
ishitatsuyuki
May 21, 2018
Contributor
Nit: can/should we use normal comments here? This doesn't seem useful when shown in rustdoc.
Nit: can/should we use normal comments here? This doesn't seem useful when shown in rustdoc.
|
@bors r+ |
|
|
|
@bors rollup |
…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.
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:
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.
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.