]> git.lizzy.rs Git - rust.git/commit - src/tools/clippy
Auto merge of #69290 - wesleywiser:speed_up_ctfe_stress_4, r=RalfJung
authorbors <bors@rust-lang.org>
Fri, 21 Feb 2020 06:43:40 +0000 (06:43 +0000)
committerbors <bors@rust-lang.org>
Fri, 21 Feb 2020 06:43:40 +0000 (06:43 +0000)
commit01a8b5f26e536a3bcd9449f62fd0b9b68ef3d650
treef0a6ed6876169822d95d6d69a8757f1bde3997be
parent2851e59a52673e0242532035047009c6e121c95a
parent9f3bc82fe40fd38fadfd24b7968548929abc9d4c
Auto merge of #69290 - wesleywiser:speed_up_ctfe_stress_4, r=RalfJung

Check `RUSTC_CTFE_BACKTRACE` much less by generating fewer errors

Before this change, `get_size_and_align()`  calls `get_fn_alloc()` *a
lot* in CTFE heavy code. This previously returned an `Error` which would
check if `RUSTC_CTFE_BACKTRACE` was set on construction. Doing this
turned out to be a performance hotspot as @nnethercote discovered in
#68792.

This is an alternate take on that PR which resolves the performance
issue by generating *many* fewer errors. Previously, `ctfe-stress-4`
would generate over 5,000,000 errors each of which would check for the
presence of the environment variable. With these changes, that number is
reduced to 30.

r? @RalfJung