Skip to content

Commit

Permalink
Refine performance report
Browse files Browse the repository at this point in the history
- no longer do the rough benchmark as the internal benchmark has more
  information and appears to be more stable
- try to append the report to the CI job summary to be able to compare runs
  • Loading branch information
lukastaegert committed Oct 28, 2024
1 parent 32d0e7d commit 8cc07f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/performance-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,6 @@ jobs:
echo "export { rollup as newRollup } from '../../_benchmark/current/rollup.js';" >> ./scripts/perf-report/rollup-artefacts.js
- name: Run internal benchmark
run: node --expose-gc scripts/perf-report/index.js
- name: Install benchmark tool
run: cargo install --locked hyperfine
- name: Run Rough benchmark
run: |
hyperfine --warmup 1 --export-markdown _benchmark/rough-report.md --show-output --runs 3 \
'node _benchmark/previous/bin/rollup -i ./perf/entry.js -o _benchmark/result/previous.js' \
'node _benchmark/current/bin/rollup -i ./perf/entry.js -o _benchmark/result/current.js'
- name: Combine benchmark reports
run: |
echo "# Performance report!" > _benchmark/result.md
echo "## Rough benchmark" >> _benchmark/result.md
cat _benchmark/rough-report.md >> _benchmark/result.md
echo "## Internal benchmark" >> _benchmark/result.md
cat _benchmark/internal-report.md >> _benchmark/result.md
- name: Find Performance report
uses: peter-evans/find-comment@v3
id: findPerformanceReport
Expand Down
12 changes: 7 additions & 5 deletions scripts/perf-report/report-collector.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { writeFile } from 'node:fs/promises';
import { appendFile, writeFile } from 'node:fs/promises';
import { fileURLToPath } from 'node:url';

export default new (class ReportCollector {
Expand Down Expand Up @@ -28,10 +28,12 @@ export default new (class ReportCollector {
}
outputMsg() {
if (process.env.CI) {
return writeFile(
fileURLToPath(new URL('../../_benchmark/internal-report.md', import.meta.url)),
removeAnsiStyles(this.#messageList.join('\n'))
);
const result = `# Performance report
${removeAnsiStyles(this.#messageList.join('\n'))}`;
return Promise.all([
writeFile(fileURLToPath(new URL('../../_benchmark/result.md', import.meta.url)), result),
process.env.GITHUB_STEP_SUMMARY && appendFile(process.env.GITHUB_STEP_SUMMARY, result)
]);
}
}
})();
Expand Down

0 comments on commit 8cc07f9

Please sign in to comment.