finnpy_to_packed_bytearray can be slow, which isn't too much of a concern at compile-time but will reduce performance at runtime.
To address one little part of this problem, this PR introduces fast_mode support when packing 1-bit types by using numpy.packbits. An extra condition (total bits must be divisible by 8) is introduced to remain compatible with what the original does, which does not match with what numpy does if the condition is violated.
finnpy_to_packed_bytearray
can be slow, which isn't too much of a concern at compile-time but will reduce performance at runtime.To address one little part of this problem, this PR introduces
fast_mode
support when packing 1-bit types by usingnumpy.packbits
. An extra condition (total bits must be divisible by 8) is introduced to remain compatible with what the original does, which does not match with what numpy does if the condition is violated.