Skip to content

Commit 1094b3c

Browse files
committed
rewrite benchmark suite
Rewrites the benchmark suite to include a full matrix of different variations, among 4 different fixtures and 7 different scenarios along with fixing the graph render and url deploy. Fixes: vltpkg/statusboard#197 Fixes: vltpkg/statusboard#9 Fixes: vltpkg/statusboard#28
1 parent c6be91a commit 1094b3c

34 files changed

+1380
-630
lines changed

.editorconfig

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# All files
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
# Shell scripts
14+
[*.sh]
15+
indent_style = space
16+
indent_size = 2
17+
18+
# JavaScript/TypeScript files
19+
[*.{js,mjs,ts}]
20+
indent_style = space
21+
indent_size = 2
22+
23+
# JSON files
24+
[*.json]
25+
indent_style = space
26+
indent_size = 2
27+
28+
# CSS files
29+
[*.css]
30+
indent_style = space
31+
indent_size = 2
32+
33+
# HTML files
34+
[*.html]
35+
indent_style = space
36+
indent_size = 2
37+
# Markdown files
38+
[*.md]
39+
trim_trailing_whitespace = false
40+
41+
# Package.json files
42+
[package.json]
43+
indent_style = space
44+
indent_size = 2

.github/workflows/benchmark.yaml

Lines changed: 51 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,171 +1,112 @@
11
name: Package Manager Benchmarks
2-
on:
2+
on:
33
push:
44
workflow_dispatch:
5+
inputs:
6+
fixtures:
7+
description: 'The fixture to run the benchmarks on'
8+
default: '["next", "astro", "svelte", "vue"]'
9+
variations:
10+
description: 'The benchmark variations to run'
11+
default: '["cache", "cache+lockfile", "cache+node_modules", "cache+lockfile+node_modules", "clean", "lockfile", "lockfile+node_modules", "node_modules"]'
12+
binaries:
13+
description: 'The binaries to run the benchmarks on'
14+
default: '"npm,yarn,berry,pnpm,vlt,bun,deno,nx,turbo,node"'
15+
warmup:
16+
description: 'The number of warmup runs on each benchmark'
17+
default: '2'
18+
runs:
19+
description: 'The number of runs on each benchmark'
20+
default: '10'
521
schedule:
6-
- cron: "0 0 * * *"
22+
- cron: "5 23 * * *"
723

824
# Prevent multiple runs from interfering with each other
925
concurrency:
1026
group: ${{ github.workflow }}-${{ github.ref }}
1127
cancel-in-progress: true
1228

1329
jobs:
14-
setup:
15-
name: 'Setup'
16-
runs-on: blacksmith-4vcpu-ubuntu-2404
17-
timeout-minutes: 10
18-
steps:
19-
- uses: actions/checkout@v4
20-
- name: Cache Bins
21-
uses: useblacksmith/cache@v5
22-
with:
23-
path: bins
24-
key: bins
25-
- name: Install Node
26-
uses: useblacksmith/setup-node@v5
27-
with:
28-
node-version: '22'
29-
- name: Install & Setup Tools
30-
run: |
31-
bash ./scripts/setup.sh
32-
3330
benchmark:
3431
name: 'Run Benchmarks'
35-
runs-on: blacksmith-4vcpu-ubuntu-2404
36-
needs: [setup]
37-
timeout-minutes: 30
32+
runs-on: ubuntu-latest
33+
timeout-minutes: 60
3834
strategy:
3935
matrix:
40-
project: [next, astro, svelte, vue]
41-
cache: [cold, warm]
36+
fixture: ${{ fromJson(inputs.fixtures || '["next", "astro", "vue", "svelte"]') }}
37+
variation: ${{ fromJson(inputs.variations || '["cache", "cache+lockfile", "cache+node_modules", "cache+lockfile+node_modules", "clean", "lockfile", "lockfile+node_modules", "node_modules"]') }}
4238
include:
43-
- project: next
44-
cache: cold
45-
- project: astro
46-
cache: cold
47-
- project: svelte
48-
cache: cold
49-
- project: vue
50-
cache: cold
51-
- project: next
52-
cache: warm
53-
- project: astro
54-
cache: warm
55-
- project: svelte
56-
cache: warm
57-
- project: vue
58-
cache: warm
39+
- variation: "run"
40+
fixture: "run"
41+
env:
42+
BENCH_INCLUDE: ${{ fromJson(inputs.binaries || '"npm,yarn,berry,pnpm,vlt,bun,deno,nx,turbo,node"') }}
43+
BENCH_WARMUP: ${{ inputs.warmup || '2' }}
44+
BENCH_RUNS: ${{ inputs.runs || '10' }}
5945
steps:
6046
- uses: actions/checkout@v4
6147
- name: Install Node
62-
uses: useblacksmith/setup-node@v5
48+
uses: actions/setup-node@v4
6349
with:
64-
node-version: '22'
65-
- name: Install System Dependencies
50+
node-version: '24'
51+
- name: Install & Setup Tools
6652
run: |
67-
sudo apt-get update
68-
sudo apt-get install -y jq hyperfine
69-
- name: Restore Bins
70-
uses: useblacksmith/cache/restore@v5
71-
with:
72-
path: bins
73-
key: bins
74-
- name: Run Project Benchmarks
53+
bash ./scripts/setup.sh
54+
- name: Run Benchmarks variations
7555
run: |
76-
if [ "${{ matrix.cache }}" = "warm" ]; then
77-
bash ./scripts/install-warm.sh ${{ matrix.project }}
56+
if [ "${{ matrix.variation }}" = "run" ]; then
57+
bash ./scripts/benchmark.sh run run
7858
else
79-
bash ./scripts/install.sh ${{ matrix.project }}
59+
bash ./scripts/benchmark.sh ${{ matrix.fixture }} ${{ matrix.variation }}
8060
fi
8161
- name: Upload Benchmark Results
8262
uses: actions/upload-artifact@v4
8363
with:
84-
name: ${{ matrix.project }}-${{ matrix.cache }}-results
85-
path: ./results/${{ matrix.project }}/
86-
retention-days: 7
87-
88-
task:
89-
name: 'Benchmark Running Tasks'
90-
runs-on: blacksmith-4vcpu-ubuntu-2404
91-
needs: [setup]
92-
timeout-minutes: 15
93-
steps:
94-
- uses: actions/checkout@v4
95-
- name: Install Node
96-
uses: useblacksmith/setup-node@v5
97-
with:
98-
node-version: '22'
99-
- name: Install System Dependencies
100-
run: |
101-
sudo apt-get update
102-
sudo apt-get install -y jq hyperfine
103-
- name: Restore Bins
104-
uses: useblacksmith/cache/restore@v5
105-
with:
106-
path: bins
107-
key: bins
108-
- name: Run Task Execution Benchmarks
109-
run: |
110-
bash ./scripts/run.sh
111-
- name: Upload Benchmark Results
112-
uses: actions/upload-artifact@v4
113-
with:
114-
name: task-benchmark-results
115-
path: ./results/run.json
64+
name: results-${{ matrix.fixture }}-${{ matrix.variation }}
65+
path: ./results/${{ matrix.fixture }}/${{ matrix.variation }}/
11666
retention-days: 7
117-
11867
process:
11968
name: 'Process Results'
120-
runs-on: blacksmith-4vcpu-ubuntu-2404
121-
needs: [benchmark, task]
69+
runs-on: ubuntu-latest
70+
needs: [benchmark]
12271
timeout-minutes: 5
12372
steps:
12473
- uses: actions/checkout@v4
12574
- name: Install Node
126-
uses: useblacksmith/setup-node@v5
75+
uses: actions/setup-node@v4
12776
with:
128-
node-version: '22'
77+
node-version: '24'
12978
- name: Download Results
13079
uses: actions/download-artifact@v4
13180
with:
13281
path: results
133-
merge-multiple: true
82+
pattern: results-*
13483
- name: Process Results
13584
run: |
13685
bash ./scripts/process-results.sh
13786
- name: Upload Processed Results
13887
uses: actions/upload-artifact@v4
13988
with:
140-
name: processed-results
141-
path: chart/results/
89+
name: charts
90+
path: charts
14291
retention-days: 7
143-
14492
deploy:
14593
name: 'Deploy Results'
146-
runs-on: blacksmith-4vcpu-ubuntu-2404
94+
runs-on: ubuntu-latest
14795
needs: [process]
96+
permissions:
97+
contents: write
14898
if: github.ref == 'refs/heads/main'
14999
steps:
150100
- uses: actions/checkout@v4
151101
- name: Download Results
152102
uses: actions/download-artifact@v4
153103
with:
154-
name: processed-results
155-
path: chart/results/
104+
name: charts
105+
path: charts/
156106
- name: Deploy to GitHub Pages
157107
uses: peaceiris/actions-gh-pages@v3
158108
with:
159109
github_token: ${{ secrets.GITHUB_TOKEN }}
160-
publish_dir: chart/results
110+
publish_dir: charts
161111
force_orphan: true
162112

163-
cleanup:
164-
name: 'Cleanup'
165-
needs: [deploy]
166-
runs-on: blacksmith-4vcpu-ubuntu-2404
167-
if: always()
168-
steps:
169-
- name: Delete old artifacts
170-
run: |
171-
gh api repos/${{ github.repository }}/actions/artifacts --paginate | jq -r '.artifacts[] | select(.expired) | .id' | xargs -I {} gh api repos/${{ github.repository }}/actions/artifacts/{} -X DELETE

LICENSE

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Copyright (c) vlt technology, Inc.
2+
3+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4+
5+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
6+
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
7+
Subject to the terms and conditions of this license, each copyright holder and contributor hereby grants to those receiving rights under this license a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except for failure to satisfy the conditions of this license) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer this software, where such license applies only to those patent claims, already acquired or hereafter acquired, licensable by such copyright holder or contributor that are necessarily infringed by:
8+
9+
(a) their Contribution(s) (the licensed copyrights of copyright holders and non-copyrightable additions of contributors, in source or binary form) alone; or
10+
(b) combination of their Contribution(s) with the work of authorship to which such Contribution(s) was added by such copyright holder or contributor, if, at the time the Contribution is added, such addition causes such combination to be necessarily infringed. The patent license shall not apply to any other combinations which include the Contribution.
11+
Except as expressly stated above, no rights or licenses from any copyright holder or contributor is granted under this license, whether expressly, by implication, estoppel or otherwise.
12+
13+
DISCLAIMER
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

0 commit comments

Comments
 (0)