diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2018-04-19 08:56:27 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2018-04-19 08:56:27 +1000 |
| commit | 5070dea2366104fb0b5c344ce7f2a5cf8af176b0 (patch) | |
| tree | f124d222d034defe7ca4361f70c017ffef173fce /src/test/incremental/thinlto | |
| parent | 23561c6747b0916e852aaa2a5d04c0b0eeddc6de (diff) | |
| download | rust-5070dea2366104fb0b5c344ce7f2a5cf8af176b0.tar.gz rust-5070dea2366104fb0b5c344ce7f2a5cf8af176b0.zip | |
Lazily evaluate EvalErrorKind::*.into() calls.
eval_context.rs calls `ok_or` in multiple places with an eagerly
evaluated `EvalErrorKind::*.into()` argument, which calls
EvalError::from(), which calls env::var("MIRI_BACKTRACE"), which
allocates a String. This code is hot enough for this to have a
measurable effect on some benchmarks.
This patch changes the `ok_or` calls into `ok_or_else`, thus avoiding
the evaluations when they're not needed. As a result, most of the
rustc-perf benchmarks get a measurable speedup, particularly the
shorter-running ones, where the improvement is as high as 6%.
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
