-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nbits=1 unpacking order and benchmarks #6
Comments
Interesting! Would we just need to edit https://github.com/telegraphic/numbits/blob/master/src/numbits.cpp#L44 to reverse the order? After some digging the numpy code is here: It looks insanely complicated, so surprised it's faster. I suspect it's multithreading? Could you add this at the top and see if speed changes?
(from https://stackoverflow.com/questions/17053671/how-do-you-stop-numpy-from-multithreading) My understanding is that 'there be dragons' with openmp with pybind due to the GIL, so may not be straightforward to match numpy, if it is indeed multithreading. |
yes, I think reversing the order would do: It could be multithreading. I run the script again with the following before importing numpy.
I get the same results for i7-7500U (laptop), but a bit different on OzSTAR CPU (still faster).
|
Fixed by #9 |
The order of the returned bits in
unpack(array, nbits=1)
is "little", while it should be big-endian to be consistent?Checked with
numpy.unpackbits
.Also, the numpy function is much faster. Benchmarked using the script stress_numbits.py from #1
The text was updated successfully, but these errors were encountered: