-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hey @isoos,
I think there's a simple way to improve the performance of all the set operations of BitArray on other BitArrays by specializing them to take a BitArray and using that knowledge to avoid using iterators.
That is, I've observed that we can be more efficient if we replace the following:
// ... and and/andNot/xor
void or(BitSet set) {
final iter = set.asUint32Iterable().iterator;
for (var i = 0; i < _data.length && iter.moveNext(); i++) {
_data[i] |= iter.current;
}
}with
// ... and and/andNot/xor
void or(BitArray set) {
final Uint32List data2 = set._data;
for (var i = 0; i < _data.length && i < data2.length; i++) {
_data[i] |= data2[i];
}
}I'm not proposing to replace the existing set operations, but to add new ones that work on BitArrays only.
What do you think?
Metadata
Metadata
Assignees
Labels
No labels