analyze: borrowck performance improvements #1111
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I found some easy borrowck/Polonius performance improvements while investigating a performance regression on a development branch.
BufReader
/BufWriter
when loading/saving from thepolonius_cache
. Otherwisebincode
reads/writes each 8-byte field individually.inspect/FUNC/*.facts
unless requested withC2RUST_ANALYZE_DUMP_POLONIUS_FACTS=1
. This takes a nontrivial amount of time for big functions and is only needed when debugging certain borrowck issues.Improvements compared to master (all measurements taken on the second run, after populating
polonius_cache/
):cargo test algo_md5
: 25s -> 4.6scargo test --release algo_md5
: 16s -> 2.1s