Closed Centril closed 2 weeks ago
Why did you choose to make
FixedBitSet
generic overB: BitBlock
, rather than just usingu64
directly?
Initially, I started off with a type alias type BitBlock = u32;
, but eventually I felt that B
being generic helped enforce "unit correctness" and I also heard that James might want a custom bitset for other places.
Did you run any experiments with different block sizes?
Initially, I tried u32
just because that was the previous block size for BitVec
. However, changing to u64
did give some slight improvements in benchmarks. They were not huge, but they were notable. I don't recall how significant they were however.
Do you foresee us wanting to choose a different block size?
Might be that James's use case wants u32
to be more dense, but u64
might also be all we want.
Just went through code, It was fun to read FixedBitSet
code. I really appreciate how well the code is written. Thanks! :raised_hands:
Description of Changes
present_rows
to only take up 10 bytes. Fixes #1152.bit-vec
dependency in favor ofFixedBitSet
so we can achieve the above.Page::iter_fixed_len
to use atrailing_zeros
approach. This improves performance of theiter_read_fixed_len
for all cases significantly (see results below).miri
).Benchmarks as compared to
HEAD~1
(branched master) on i7-7700K, 64GB RAM.API and ABI breaking changes
None
Expected complexity level and risk
2, contained changes, but some unsafe included.
Testing
Proptests are included and they have been run in miri