cbitstruct vs bitstruct_c vs numpy

Issue #3 new
Arun Persaud created an issue

We currently use bitstruct to decode binary data. To speed things up we try to import a c-compiled version called cbitstruct. However, cbitstruct does not supply pre-compiled wheels for all platforms (only available for linux at the moment).

Bitstruct comes with its own version of a C-compiled module that can be imported as bistruct_c, which we probably should move to. However, when trying this out, the program segfaulted! We should try to figure out why that is and fix it.

The other option that we should try out and time to see if its faster to just use numpy directly. Here we would have to sort the events by channel, then for each channel we can convert events into a 2d numpy array and then use numpy functions to work on the 2d arrays, i.e., numpy.bitwise_and(2d_array_of_events, 7<<13) to get the values of 3 bits at position 13,14,15. It is unclear to me if this is faster or slower than the compiled bitstruct version and one would have to time this on different platforms.

Comments (0)

  1. Log in to comment