Commit 9e0c9da
Try smaller segment length in binary fuse build
Some sizes around segment length transitions require many iterations
and would work much better with the previous segment length.
We add a simple fix that is more robust than tweaking the formula:
once every four iterations, we try the previous segment length while
keeping the same capacity. Note that in most cases this won't affect
the build because it's rare to need more than 1-2 iterations.
`TestBinaryFuseBoundarySizes` output (with numTrials=100):
```
binaryfusefilter_test.go:490: size: 2 iterations: 1.02 avg (2 max)
binaryfusefilter_test.go:490: size: 8 iterations: 1.08 avg (3 max)
binaryfusefilter_test.go:490: size: 24 iterations: 1.08 avg (3 max)
binaryfusefilter_test.go:490: size: 27 iterations: 1.03 avg (2 max)
binaryfusefilter_test.go:490: size: 55 iterations: 1.02 avg (2 max)
binaryfusefilter_test.go:490: size: 91 iterations: 1.02 avg (2 max)
binaryfusefilter_test.go:490: size: 120 iterations: 1.04 avg (2 max)
binaryfusefilter_test.go:490: size: 303 iterations: 1.04 avg (2 max)
binaryfusefilter_test.go:490: size: 349 iterations: 1.01 avg (2 max)
binaryfusefilter_test.go:490: size: 1009 iterations: 1.01 avg (2 max)
binaryfusefilter_test.go:490: size: 1124 iterations: 1.16 avg (4 max)
binaryfusefilter_test.go:490: size: 3361 iterations: 1.03 avg (2 max)
binaryfusefilter_test.go:490: size: 3551 iterations: 2.05 avg (6 max)
binaryfusefilter_test.go:490: size: 11192 iterations: 1.04 avg (3 max)
binaryfusefilter_test.go:490: size: 11521 iterations: 2.10 avg (6 max)
binaryfusefilter_test.go:490: size: 37272 iterations: 1.01 avg (2 max)
binaryfusefilter_test.go:490: size: 37454 iterations: 2.09 avg (6 max)
binaryfusefilter_test.go:490: size: 124117 iterations: 1.03 avg (2 max)
binaryfusefilter_test.go:490: size: 126131 iterations: 1.53 avg (4 max)
binaryfusefilter_test.go:490: size: 413309 iterations: 1.00 avg (1 max)
binaryfusefilter_test.go:490: size: 416077 iterations: 1.50 avg (4 max)
binaryfusefilter_test.go:490: size: 1376321 iterations: 1.02 avg (3 max)
```1 parent 292bf84 commit 9e0c9da
1 file changed
+20
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
93 | 113 | | |
94 | 114 | | |
95 | 115 | | |
| |||
0 commit comments