We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 702349c commit b956e49Copy full SHA for b956e49
docs/src/perf_tips.md
@@ -25,13 +25,18 @@ iter = 1:10^7;
25
26
Running with both version we get
27
28
-```@example 1
29
-@benchmark fit_iter!(rs, $iter) setup=(rs = ReservoirSampler{Int}(10, AlgRSWRSKIP(); mutable = true))
+```julia
+@btime fit_iter!(rs, $iter) setup=(rs = ReservoirSampler{Int}(10, AlgRSWRSKIP(); mutable = true))
30
+```
31
32
+ 6.535 ms (2 allocations: 144 bytes)
33
34
```
-
35
@benchmark fit_iter!(rs, $iter) setup=(rs = ReservoirSampler{Int}(10, AlgRSWRSKIP(); mutable = false))
36
37
38
+ 4.816 ms (2 allocations: 144 bytes)
39
40
41
As you can see, the immutable version is 50% faster than
42
the mutable one. In general, more the ratio between reservoir
0 commit comments