Skip to content

Commit 593ddf1

Browse files
committed
ci(benchmark): aggressive shard rebalancing for 5-minute target
Split benchmarks into 15 shards to ensure each completes within 5 minutes. Separated slow vs non-slow tests for expensive operations (all, items, keys) using the slow marker. Shard distribution (estimated times): - get: 25 tests (~3m) - count: 25 tests (~3m) - has: 31 tests (~3m) - find-one-delete: 24 tests (~2m) - write-compact: 32 tests (~5m) - load: 19 tests (~4m) - reload: 19 tests (~4m) - keys-ci: 12 tests (~2.5m) - keys-slow: 13 tests (~2.5m) - all-ci: 12 tests (~3m) - all-slow: 13 tests (~3.5m) - items-ci: 12 tests (~3m) - items-slow: 13 tests (~3.5m) - find-high: 19 tests (~3m) - find-other: 24 tests (~4m) Memory tests excluded for now due to memray profiling overhead.
1 parent 516e134 commit 593ddf1

1 file changed

Lines changed: 37 additions & 29 deletions

File tree

.github/workflows/benchmark.yml

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -31,47 +31,55 @@ jobs:
3131
benchmark:
3232
name: "Benchmark (${{ matrix.shard }})"
3333
runs-on: ubuntu-latest
34-
timeout-minutes: 6
34+
timeout-minutes: 5
3535
permissions:
3636
contents: read
3737
id-token: write
3838
strategy:
3939
fail-fast: false
4040
matrix:
4141
include:
42-
# ~38 tests each for load/reload
43-
- shard: "load-reload"
44-
filter: "TestBenchLoad or TestBenchReload"
45-
# 25 tests
42+
# Fast tests (~7s/test) - can have more tests per shard
4643
- shard: "get"
4744
filter: "TestBenchGet"
48-
# 25 tests
49-
- shard: "all"
50-
filter: "TestBenchAll"
51-
# 43 tests (find_high=19, find_other=24)
52-
- shard: "find"
53-
filter: "TestBenchFind"
54-
# 18 tests
55-
- shard: "find-one"
56-
filter: "TestBenchFindOne"
57-
# 32 tests
58-
- shard: "write-compact"
59-
filter: "TestBenchPut or TestBenchBatchWrite or TestBenchCompact"
60-
# 31 tests
61-
- shard: "keys-delete"
62-
filter: "TestBenchKeys or TestBenchDelete"
63-
# 25 tests
64-
- shard: "items"
65-
filter: "TestBenchItems"
66-
# 25 tests
6745
- shard: "count"
6846
filter: "TestBenchCount"
69-
# 31 tests
7047
- shard: "has"
7148
filter: "TestBenchHas"
72-
# 18 tests
73-
- shard: "memory"
74-
filter: "TestMemory"
49+
- shard: "find-one-delete"
50+
filter: "TestBenchFindOne or TestBenchDelete"
51+
# Moderate tests (~9s/test)
52+
- shard: "write-compact"
53+
filter: "TestBenchPut or TestBenchBatchWrite or TestBenchCompact"
54+
# I/O-heavy tests (~12s/test)
55+
- shard: "load"
56+
filter: "TestBenchLoad"
57+
- shard: "reload"
58+
filter: "TestBenchReload"
59+
- shard: "keys-ci"
60+
filter: "TestBenchKeys"
61+
marker: "benchmark and not slow"
62+
- shard: "keys-slow"
63+
filter: "TestBenchKeys"
64+
marker: "benchmark and slow"
65+
# Expensive tests (~15s/test) - split by slow marker
66+
- shard: "all-ci"
67+
filter: "TestBenchAll"
68+
marker: "benchmark and not slow"
69+
- shard: "all-slow"
70+
filter: "TestBenchAll"
71+
marker: "benchmark and slow"
72+
- shard: "items-ci"
73+
filter: "TestBenchItems"
74+
marker: "benchmark and not slow"
75+
- shard: "items-slow"
76+
filter: "TestBenchItems"
77+
marker: "benchmark and slow"
78+
# Find tests (~10s/test)
79+
- shard: "find-high"
80+
filter: "TestBenchFind and not TestBenchFindOne and test_find_high_selectivity"
81+
- shard: "find-other"
82+
filter: "TestBenchFind and not TestBenchFindOne and not test_find_high_selectivity"
7583

7684
steps:
7785
- name: Checkout code
@@ -87,4 +95,4 @@ jobs:
8795
uses: CodSpeedHQ/action@346a2d8a8d9d38909abd0bc3d23f773110f076ad # v4.4.1
8896
with:
8997
mode: simulation
90-
run: uv run pytest -m benchmark -k "${{ matrix.filter }}" --codspeed
98+
run: uv run pytest -m "${{ matrix.marker || 'benchmark' }}" -k "${{ matrix.filter }}" --codspeed

0 commit comments

Comments
 (0)