bloom-filter icon indicating copy to clipboard operation
bloom-filter copied to clipboard

Dropping ArrayAccess from BitArray

Open kktsvetkov opened this issue 3 years ago • 1 comments

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.

kktsvetkov avatar Sep 12 '22 05:09 kktsvetkov

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

kktsvetkov avatar Sep 12 '22 06:09 kktsvetkov