ci(benchmarks/formatter): Update formatter bench with sort-imports#15584
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
@Dunqing ↑ Does that make sense? |
CodSpeed Performance ReportMerging #15584 will degrade performances by 20.95%Comparing Summary
Benchmarks breakdown
Footnotes |
|
No, the formatter alone is faster than enabling the sorting feature, no doubt. We don't have any reason to care about this. The purpose of turning on the sorting import feature in the Formatter benchmark is to help us catch any performance regressions early. For example, you made some improvements to the sorting import feature recently, but we don't have any way to verify whether your changes have improved or regressed the performance. Sometimes, we made improvements that we thought should make it significantly faster, but it is actually slower than before. This will avoid introducing incorrect optimization. Additionally, adding more benchmarks will increase the CI time, which causes us to wait longer for CI to complete. It is not worth adding this for a single one of the features of the formatter. |
166eaa6 to
92843a7
Compare
|
Thanks! Alright, let's just enable sorting on the existing benchmarks. |
There was a problem hiding this comment.
Pull Request Overview
This PR modifies the formatter benchmark to enable the experimental sort-imports feature, aiming to measure the performance impact of this feature. However, the current implementation replaces the baseline benchmark rather than adding a separate comparison benchmark.
Key Changes:
- Added
SortImportsimport to the formatter benchmark - Modified
FormatOptionsto enableexperimental_sort_importswith default settings
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Wow, the sorting import feature takes 15% to 20% of the time in large files. |
Merge activity
|
…15584) > I think we don't need to add another benchmark for the sort import feature; enabling it in > formatter.rs is enough. Any of the current benchmark files contains many import statements. It seems there was no need to create a separate file after all. My intention was to confirm that the benchmark for the formatter alone consistently produced better results than the benchmark with sorting enabled. To verify this, shouldn't the benchmarks be separated?
92843a7 to
65764fd
Compare

It seems there was no need to create a separate file after all.
My intention was to confirm that the benchmark for the formatter alone consistently produced better results than the benchmark with sorting enabled.
To verify this, shouldn't the benchmarks be separated?