Skip to content

Commit b956e49

Browse files
authored
Hardcode benchmarks because CI is too unstable
1 parent 702349c commit b956e49

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

docs/src/perf_tips.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ iter = 1:10^7;
2525

2626
Running with both version we get
2727

28-
```@example 1
29-
@benchmark fit_iter!(rs, $iter) setup=(rs = ReservoirSampler{Int}(10, AlgRSWRSKIP(); mutable = true))
28+
```julia
29+
@btime fit_iter!(rs, $iter) setup=(rs = ReservoirSampler{Int}(10, AlgRSWRSKIP(); mutable = true))
30+
```
31+
```julia
32+
6.535 ms (2 allocations: 144 bytes)
33+
```
3034
```
31-
32-
```@example 1
3335
@benchmark fit_iter!(rs, $iter) setup=(rs = ReservoirSampler{Int}(10, AlgRSWRSKIP(); mutable = false))
3436
```
37+
```julia
38+
4.816 ms (2 allocations: 144 bytes)
39+
```
3540

3641
As you can see, the immutable version is 50% faster than
3742
the mutable one. In general, more the ratio between reservoir

0 commit comments

Comments
 (0)