rust-lang / rustc-perf

Website for graphing performance of rustc
https://perf.rust-lang.org
Other
602 stars 146 forks source link

Cli tool to compare commits locally #1734

Open Nadrieril opened 8 months ago

Nadrieril commented 8 months ago

Hi! I tend to work on performance-sensitive parts of the compiler so I check performance locally a lot. In the current setup this requires me to run a docker script and check a website page. It would make my life much easier if I could run say rustc-perf compare <commita> <commitb> instructions:u and get out the little table of relevant benchmark diffs. Would that be easy to implement?

Kobzol commented 8 months ago

Hi, you don't really have to run Docker, you can either just build the website locally (using npm run watch && cargo build -p site) or you can download a precompiled binary with the website (https://github.com/rust-lang/rustc-perf/releases).

That being said, a basic CLI output wouldn't be a bad idea, we already have it for runtime benchmarks.

It should be relatively easy to implement, either by modifying the behavior of bench_local, and adding output of the measured results, or by introducing a separate new command for this. The collector code was heavily refactored and running benchmarks from it in a new command should hopefully be relatively easy.