lemire / FastBitSet.js

Speed-optimized BitSet implementation for modern browsers and JavaScript engines
Apache License 2.0
158 stars 19 forks source link

new method and improvements #12

Closed ebrensi closed 3 years ago

ebrensi commented 3 years ago

Hello again and happy new year. In this pull request I have

Note: I disabled the infusion.BitSet.js benchmark for ArrayBench() because for some reason it was making my laptop hang.

ebrensi commented 3 years ago

Here are relevant benchmarks from my laptop

change

starting inplace change (XOR) benchmark
FastBitSet (inplace) x 90.15 ops/sec ±0.31% (79 runs sampled)
infusion.BitSet.js (inplace) x 0.79 ops/sec ±2.85% (6 runs sampled)
tdegrunt.BitSet (inplace) x 0.78 ops/sec ±4.55% (6 runs sampled)
roaring x 432 ops/sec ±1.14% (97 runs sampled)
Set (inplace) x 4.23 ops/sec ±3.03% (15 runs sampled)

new_change

starting change (XOR) query benchmark
roaring x 1,064 ops/sec ±39.31% (42 runs sampled)
FastBitSet (creates new bitset) x 26.86 ops/sec ±3.93% (50 runs sampled)
mattkrick.fast-bitset (creates new bitset) x 10.18 ops/sec ±7.47% (30 runs sampled)
Set x 1.99 ops/sec ±4.48% (10 runs sampled)

difference2

starting inplace difference benchmark
FastBitSet (inplace) x 7,865 ops/sec ±8.90% (100 runs sampled)
FastBitSet (inplace2) x 7,274 ops/sec ±7.82% (99 runs sampled)
TypedFastBitSet (inplace) x 6,503 ops/sec ±2.89% (97 runs sampled)
infusion.BitSet.js (inplace) x 19.36 ops/sec ±8.89% (37 runs sampled)
tdegrunt.BitSet (inplace) x 22.18 ops/sec ±5.03% (40 runs sampled)
roaring x 50,038 ops/sec ±1.19% (94 runs sampled)
Set (inplace) x 4.42 ops/sec ±2.36% (16 runs sampled)
lemire commented 3 years ago

Looks good. Please consider my specific comment above.