about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorWesley Wiser <wwiser@gmail.com>2020-02-19 07:59:21 -0500
committerWesley Wiser <wwiser@gmail.com>2020-02-19 18:28:37 -0500
commit9f3bc82fe40fd38fadfd24b7968548929abc9d4c (patch)
treeb3e01662a61cb256a36713f5fed3c15068a8afea /src/libstd/sys/unix/stack_overflow.rs
parentae5467826d1e677aff4662fc0481ace33761fc90 (diff)
downloadrust-9f3bc82fe40fd38fadfd24b7968548929abc9d4c.tar.gz
rust-9f3bc82fe40fd38fadfd24b7968548929abc9d4c.zip
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.
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions