bloom-filter
bloom-filter copied to clipboard
Dropping ArrayAccess from BitArray
Have you considered not using ArrayAcess in BitArray? There are some performance implications as it is a tad slower instead of directly calling a method from the class. Additionally, in Bloom Filters there is no way to remove elements, which makes the BitArray::offsetUnset() rather useless.
Perhaps some aggregator-like behaviour with ::has() (or ::exists()) and ::add() methods could do the same job more quickly.
This type of change is a good candidate for a phpbenchmark test, as it will show what type of gains are going to be there if the ArrayAccess interface is not used