You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anyhow seems to have include two backtrace strategies: one for stable and one for nightly. The former is managed by default-off Cargo feature "backtrace", but the latter is turned on automatically on nightly regardless of Cargo feature.
This may add more code to the executable, making anyhow significantly more bloated compared to Box<dyn Error+Send+Sync> in some scenarios. I see 92 additional kilobytes in .text section according to cargo bloat, which disappear when I manually edit out all Anyhow's code sections with #[cfg(backtrace)].
I think both backtracing modes should be adjustable by Cargo features. Anyhow may check #[cfg(backtrace)] only once, e.g. to compile_error! if Cargo feature for nightly-style backtraces is enabled on non-nightly. At the very least a negative Cargo feature like prohibit_backtraces should be provided to support minified builds. If user builds with -Zbuild-std-features=panic_immediate_abort to save kilobytes then backtraces are likely not welcome as well, even if natively supported by the compiler.
Anyhow seems to have include two backtrace strategies: one for stable and one for nightly. The former is managed by default-off Cargo feature "backtrace", but the latter is turned on automatically on nightly regardless of Cargo feature.
This may add more code to the executable, making
anyhow
significantly more bloated compared toBox<dyn Error+Send+Sync>
in some scenarios. I see 92 additional kilobytes in.text
section according tocargo bloat
, which disappear when I manually edit out all Anyhow's code sections with#[cfg(backtrace)]
.I think both backtracing modes should be adjustable by Cargo features. Anyhow may check
#[cfg(backtrace)]
only once, e.g. tocompile_error!
if Cargo feature for nightly-style backtraces is enabled on non-nightly. At the very least a negative Cargo feature likeprohibit_backtraces
should be provided to support minified builds. If user builds with-Zbuild-std-features=panic_immediate_abort
to save kilobytes then backtraces are likely not welcome as well, even if natively supported by the compiler.Related: #230.
The text was updated successfully, but these errors were encountered: