Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
saethlin opened this issue May 20, 2022 · 0 comments · Fixed by #2328
Closed

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

saethlin opened this issue May 20, 2022 · 0 comments · Fixed by #2328
Labels
A-aliasing Area: This affects the aliasing model (Stacked/Tree Borrows) C-bug Category: This is a bug. I-slow Impact: Makes Miri even slower than it already is

Comments

@saethlin
Copy link
Member

saethlin commented May 20, 2022

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

@RalfJung RalfJung added A-aliasing Area: This affects the aliasing model (Stacked/Tree Borrows) I-slow Impact: Makes Miri even slower than it already is labels May 20, 2022
@RalfJung RalfJung added the C-bug Category: This is a bug. label Jun 5, 2022
@bors bors closed this as completed in af2c50f Jul 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-aliasing Area: This affects the aliasing model (Stacked/Tree Borrows) C-bug Category: This is a bug. I-slow Impact: Makes Miri even slower than it already is
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants