Skip to content

Memory allocation optimization#4489

Merged
bors[bot] merged 3 commits into
rust-lang:masterfrom
simonvandel:allocation-opt
May 16, 2020
Merged

Memory allocation optimization#4489
bors[bot] merged 3 commits into
rust-lang:masterfrom
simonvandel:allocation-opt

Conversation

@simonvandel

Copy link
Copy Markdown
Contributor

I did some profiling using DHAT, and this was what I could easily optimize without much knowledge of the codebase.

This speeds up analysis-stats on rust-analyser by ~4% on my local machine.

Benchmark
➜ rust-analyzer-base git:(master) hyperfine --min-runs=2 '/home/simon/Documents/rust-analyzer/target/release/rust-analyzer analysis-stats .' '/home/simon/Documents/rust-analyzer-base/target/release/rust-analyzer analysis-stats .'
Benchmark #1: /home/simon/Documents/rust-analyzer/target/release/rust-analyzer analysis-stats .
Time (mean ± σ): 49.621 s ± 0.317 s [User: 48.725 s, System: 0.792 s]
Range (min … max): 49.397 s … 49.846 s 2 runs

Benchmark #2: /home/simon/Documents/rust-analyzer-base/target/release/rust-analyzer analysis-stats .
Time (mean ± σ): 51.764 s ± 0.045 s [User: 50.882 s, System: 0.756 s]
Range (min … max): 51.733 s … 51.796 s 2 runs

Summary
'/home/simon/Documents/rust-analyzer/target/release/rust-analyzer analysis-stats .' ran
1.04 ± 0.01 times faster than '/home/simon/Documents/rust-analyzer-base/target/release/rust-analyzer analysis-stats .'

@matklad

matklad commented May 16, 2020

Copy link
Copy Markdown
Contributor

bors r+

Thanks @simonvandel !

I believe there should be a lot of low hanging optimization fruit here.
If you are into these kinds of things, the most impactful thing to do would be to setup continuous benchmarking :)

@bors

bors Bot commented May 16, 2020

Copy link
Copy Markdown
Contributor

@bors bors Bot merged commit 1afdc57 into rust-lang:master May 16, 2020
github-actions Bot pushed a commit that referenced this pull request Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants