-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hello @isoos!
(I hope you don't mind all the issues. Having an efficient bitset in Dart has been on my TODO list for a looong time :), and your work is the best starting point that I've been able to find so far.)
One of my BitArray-related bottlenecks appears to be related to hashCode
calculations:

What do you think about having a hashCode cache on BitArray? That is, on each mutation to the underlying BitArray buffer we'd invalidate the current hashCode (i.e., _hashCodeCache = null
) and on each invocation of hashCode
we'd set it to the current hashCode if it is not present (i.e., _hashCodeCache ??= currentHashCode
).
What do you think?
Metadata
Metadata
Assignees
Labels
No labels