You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traditional CI benchmarks are noisy (10-30% variance) because they measure wall-clock time. CodSpeed uses CPU instruction simulation instead, giving you <1% variance—so you can actually trust the results.
4
+
5
+
```python
6
+
import pytest
7
+
8
+
@pytest.mark.benchmark
9
+
deftest_my_algorithm(benchmark):
10
+
data =list(range(1000))
11
+
result = benchmark(my_algorithm, data)
12
+
assert result isnotNone
13
+
```
14
+
15
+
Run locally with `pytest` (wall-clock), in CI with `pytest --codspeed` (CPU simulation). The `--codspeed` flag only works in their CI environment—that's by design.
16
+
17
+
Gotcha: push to `main` first to establish a baseline before creating PRs.
0 commit comments