Closed
Description
ParamEnv::def_id
is only used for Chalk, which currently isn't on by default. I tried removing that field, which (among other things) reduces the size of the hot PredicateObligation
type from 40 bytes to 32 bytes. Here are some local perf results on Full
builds.
ctfe-stress-4-opt
avg: -3.1%? min: -3.1%? max: -3.1%?
unicode_normalization-check
avg: 3.0% min: 3.0% max: 3.0%
ctfe-stress-4-check
avg: -2.6%? min: -2.6%? max: -2.6%?
ctfe-stress-4-debug
avg: -2.5%? min: -2.5%? max: -2.5%?
unicode_normalization-debug
avg: 2.1% min: 2.1% max: 2.1%
piston-image-debug
avg: -1.6% min: -1.6% max: -1.6%
regression-31157-debug
avg: -1.6% min: -1.6% max: -1.6%
encoding-debug
avg: -1.6% min: -1.6% max: -1.6%
deeply-nested-debug
avg: -1.5% min: -1.5% max: -1.5%
webrender-debug
avg: -1.5% min: -1.5% max: -1.5%
cargo-debug
avg: -1.5% min: -1.5% max: -1.5%
serde-check
avg: -1.5% min: -1.5% max: -1.5%
tokio-webpush-simple-debug
avg: -1.4% min: -1.4% max: -1.4%
unicode_normalization-opt
avg: 1.4% min: 1.4% max: 1.4%
serde-debug
avg: -1.4% min: -1.4% max: -1.4%
encoding-opt
avg: -1.4% min: -1.4% max: -1.4%
webrender-wrench-debug
avg: -1.4% min: -1.4% max: -1.4%
issue-46449-debug
avg: -1.3% min: -1.3% max: -1.3%
syn-debug
avg: -1.3% min: -1.3% max: -1.3%
cranelift-codegen-debug
avg: -1.3% min: -1.3% max: -1.3%
futures-debug
avg: -1.3% min: -1.3% max: -1.3%
futures-check
avg: -1.3% min: -1.3% max: -1.3%
serde-opt
avg: -1.3% min: -1.3% max: -1.3%
clap-rs-debug
avg: -1.3% min: -1.3% max: -1.3%
ripgrep-debug
avg: -1.3% min: -1.3% max: -1.3%
deeply-nested-check
avg: -1.2% min: -1.2% max: -1.2%
hyper-2-debug
avg: -1.1% min: -1.1% max: -1.1%
regex-debug
avg: -1.1% min: -1.1% max: -1.1%
deep-vector-debug
avg: -1.1% min: -1.1% max: -1.1%
(The unicode_normalization
regression is weird, because this change results in the code clearly doing less work overall. Maybe it's a quirk of inlining or codegen, the kind of thing that may well disappear in the face of other minor changes.)
Is this field really needed?
cc @rust-lang/wg-compiler-performance