Skip to content

Perf regression related to cold path code size growth in #2075 #2132

Closed
@saethlin

Description

@saethlin

#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-aliasingArea: This affects the aliasing model (Stacked/Tree Borrows)C-bugCategory: This is a bug.I-slowImpact: Makes Miri even slower than it already is

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions