]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #53025 - ljedrz:debug_asserts_limited, r=varkor
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Sun, 12 Aug 2018 21:26:50 +0000 (23:26 +0200)
committerGitHub <noreply@github.com>
Sun, 12 Aug 2018 21:26:50 +0000 (23:26 +0200)
commitfbe6241064dd860c7bf3a361c7e6fd63bc8eb504
treeba8c532d6af8b6d6b11e085ab535f4f163f23748
parent7d3864954ef5bc2a076aa9db9da12b0481425a07
parentb187c4268c50374075d50f9dd173b13c0de2de81
Rollup merge of #53025 - ljedrz:debug_asserts_limited, r=varkor

Consider changing assert! to debug_assert! when it calls visit_with

The perf run from #52956 revealed that there were 3 benchmarks that benefited most from changing `assert!`s to `debug_assert!`s:

- issue #46449: avg -4.7% for -check
- deeply-nested (AKA #38528): avg -3.4% for -check
- regression #31157: avg -3.2% for -check

I analyzed their fixing PRs and decided to look for potentially heavy assertions in the files they modified. I noticed that all of the non-trivial ones contained indirect calls to `visit_with()`.

It might be a good idea to consider changing `assert!` to `debug_assert!` in those places in order to get the performance wins shown by the benchmarks.