Description
#2075 added a small but significant (~8%) runtime regression to Miri because it changed a simple comparison of an Option<NonZeroU64>
to a HashSet::contains
call. This causes significant code size growth in a few functions, most notably Stack::check_protector
(now called item_popped
), which no longer gets inlined. The perf hit is particularly outsized here due to the large total size of all the arguments passed to Stack::check_protector
.
I suspect some strategic outlining of the tag tracking and error creation code paths would fix this, with the caution that the sheer size of the arguments required for all outlining sites may be an obstacle.
This perf regression will become much more noticeable once #1935 lands because currently it's easy to miss such perf issues due to the amount of time spent searching borrow stacks.