Skip to content

Always use uint8 for t2count and reverseH in buildBinaryFuse#52

Merged
lemire merged 1 commit intoFastFilter:masterfrom
RaduBerinde:count-uint8
Jan 14, 2026
Merged

Always use uint8 for t2count and reverseH in buildBinaryFuse#52
lemire merged 1 commit intoFastFilter:masterfrom
RaduBerinde:count-uint8

Conversation

@RaduBerinde
Copy link
Contributor

The values stored in these slices are independent of the fingerprint
size. It looks like maybe a mistake when the code was converted to use
generics.

This improves build performance a bit (and reduces mem usage) for
16-bit fingerprints. On an M1 laptop:

name                                old time/op    new time/op    delta
BinaryFusePopulate/16/n=1000000-10    29.4ms ± 1%    28.1ms ± 1%  -4.25%  (p=0.000 n=10+10)

name                                old MKeys/s    new MKeys/s    delta
BinaryFusePopulate/16/n=1000000-10      34.1 ± 1%      35.6 ± 1%  +4.44%  (p=0.000 n=10+10)

name                                old alloc/op   new alloc/op   delta
BinaryFusePopulate/16/n=1000000-10    28.1MB ± 0%    26.0MB ± 0%  -7.58%  (p=0.000 n=8+9)

name                                old allocs/op  new allocs/op  delta
BinaryFusePopulate/16/n=1000000-10      8.00 ± 0%      8.00 ± 0%    ~     (all equal)

The values stored in these slices are independent of the fingerprint
size. It looks like maybe a mistake when the code was converted to use
generics.

This improves build performance a bit (and reduces mem usage) for
16-bit fingerprints. On an M1 laptop:

```
name                                old time/op    new time/op    delta
BinaryFusePopulate/16/n=1000000-10    29.4ms ± 1%    28.1ms ± 1%  -4.25%  (p=0.000 n=10+10)

name                                old MKeys/s    new MKeys/s    delta
BinaryFusePopulate/16/n=1000000-10      34.1 ± 1%      35.6 ± 1%  +4.44%  (p=0.000 n=10+10)

name                                old alloc/op   new alloc/op   delta
BinaryFusePopulate/16/n=1000000-10    28.1MB ± 0%    26.0MB ± 0%  -7.58%  (p=0.000 n=8+9)

name                                old allocs/op  new allocs/op  delta
BinaryFusePopulate/16/n=1000000-10      8.00 ± 0%      8.00 ± 0%    ~     (all equal)
```
@lemire
Copy link
Member

lemire commented Jan 14, 2026

Very nice.

@lemire lemire merged commit e8256d3 into FastFilter:master Jan 14, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments