chriso/bitset

Deprecate bitset_vector_iterator_t

Closed this issue · 1 comments

Vectors need to be converted to a vector_iterator before they can be used in vector operations. For large vectors this requires allocating memory for potentially millions of individual bitset structures. When profiling large vector operations the allocations/deallocations dominate the time it takes to execute the entire operation.

Deprecate the vector_iterator by:

  • Create a bitset_vector_advance function which can be used to step through a vector buffer a single bitset at a time.
  • Replace the FOREACH macro with another that accepts bitset_vector_t as a parameter and steps through the buffer using a single temporary bitset allocated on the stack
  • Change any vector functions that accept a bitset_vector_iterator_t to instead accept a bitset_vector_t
  • Profit

Fixed in the deprecate_iterator branch and merged in e993179