11# bitvector
22
3- This repository provides a small bit vector implementation along with tests and benchmarks.
3+ A compact library focused on lightning-fast bit operations. This project delivers
4+ hardware-friendly algorithms that outpace the STL ` bitset ` , giving your
5+ applications measurable speed gains alongside an intuitive API.
46
57## Running the benchmarks without bounds checking
68
@@ -16,24 +18,16 @@ cmake --build build --config Release
1618
1719The following table shows benchmark times from the latest CI run. Each test was executed with ` 1<<20 ` bits.
1820
19- | Benchmark | Time (ns) |
20- | -----------| -----------|
21- | BM_Bowen_Set | 1826751 |
22- | BM_Std_Set | 2975545 |
23- | BM_Bowen_PushBack | 1998142 |
24- | BM_Std_PushBack | 2990558 |
25- | BM_Bowen_Access | 984200 |
26- | BM_Std_Access | 2257978 |
27- | BM_Bowen_SetBit | 2123333 |
28- | BM_Std_SetBit | 2740340 |
29- | BM_Bowen_SetBitTrueUnsafe | 1992765 |
30- | BM_Std_SetBitTrueUnsafe | 2558438 |
31- | BM_Bowen_SetBitTrue6 | 1545274 |
32- | BM_Std_SetBitTrue6 | 2601283 |
33- | BM_Bowen_QSetBitTrue6V2 | 2248553 |
34- | BM_Std_QSetBitTrue6 | 3133552 |
35- | BM_Bowen_IncrementUntilZero | 34849 |
36- | BM_Std_IncrementUntilZero | 1941798 |
21+ | My Function | Time (ns) | STL Function | Time (ns) | Speedup |
22+ | -------------| -----------| --------------| -----------| ---------|
23+ | BM_Bowen_Set | 1826751 | BM_Std_Set | 2975545 | 1.63x |
24+ | BM_Bowen_PushBack | 1998142 | BM_Std_PushBack | 2990558 | 1.50x |
25+ | BM_Bowen_Access | 984200 | BM_Std_Access | 2257978 | 2.29x |
26+ | BM_Bowen_SetBit | 2123333 | BM_Std_SetBit | 2740340 | 1.29x |
27+ | BM_Bowen_SetBitTrueUnsafe | 1992765 | BM_Std_SetBitTrueUnsafe | 2558438 | 1.28x |
28+ | BM_Bowen_SetBitTrue6 | 1545274 | BM_Std_SetBitTrue6 | 2601283 | 1.68x |
29+ | BM_Bowen_QSetBitTrue6V2 | 2248553 | BM_Std_QSetBitTrue6 | 3133552 | 1.39x |
30+ | BM_Bowen_IncrementUntilZero | 34849 | BM_Std_IncrementUntilZero | 1941798 | 55.72x |
3731
3832` BM_Bowen_IncrementUntilZero ` is the fastest benchmark, showing a substantial improvement over the standard approach.
3933
0 commit comments