chore: Sort treeshake-test results by impact in GitHub comments#2268
chore: Sort treeshake-test results by impact in GitHub comments#2268
Conversation
|
pkg.pr.new packages benchmark commit |
21c1434 to
27a4fa5
Compare
📊 Bundle Size Comparison
👀 Notable resultsStatic test results:No major changes. Dynamic test results:No major changes. 📋 All resultsClick to reveal the results table (344 entries).
If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu. |
d8d4e47 to
b8606e9
Compare
There was a problem hiding this comment.
Pull request overview
This PR improves the readability of the treeshake-test GitHub comment output by ordering results so that the most impactful bundle size changes are shown first.
Changes:
- Sort results rows by maximum absolute relative size change across all bundlers (descending).
- Add a helper (
#maxAbsoluteChange) to compute the per-row “impact” used for sorting.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const sortedResults = [...this.#results.entries()].toSorted( | ||
| ([, a], [, b]) => this.#maxAbsoluteChange(b) - this.#maxAbsoluteChange(a), | ||
| ); |
There was a problem hiding this comment.
The sort comparator recomputes #maxAbsoluteChange(...) for the same rows many times during sorting. Consider precomputing the max-change score once per row (decorate entries with the score, sort by it, then strip) to keep the sort O(n log n) without the repeated per-comparison scans over row.values().
| const sortedResults = [...this.#results.entries()].toSorted( | |
| ([, a], [, b]) => this.#maxAbsoluteChange(b) - this.#maxAbsoluteChange(a), | |
| ); | |
| const sortedResults = [...this.#results.entries()] | |
| .map(([test, row]) => [test, row, this.#maxAbsoluteChange(row)] as const) | |
| .toSorted(([, , scoreA], [, , scoreB]) => scoreB - scoreA) | |
| .map(([test, row]) => [test, row] as const); |
b8606e9 to
8e62f2b
Compare
8e62f2b to
840a244
Compare
Uh oh!
There was an error while loading. Please reload this page.