Skip to content
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

Unreasonably slow operations #295

Closed
scott-griffiths opened this issue Sep 24, 2023 · 2 comments
Closed

Unreasonably slow operations #295

scott-griffiths opened this issue Sep 24, 2023 · 2 comments
Assignees

Comments

@scott-griffiths
Copy link
Owner

This case was highlighted here: https://stackoverflow.com/questions/20845686/python-bit-array-performant in which bitstring is two orders of magnitude slower than some alternatives.

It's not meant to be as low-level as those alternatives, but now with bitarray being used under the hood it should be more competitive, but isn't yet.

It would be useful to profile this snippet to see what's going on.

  bs = bitstring.Bits(uint=0, length=64)
  for _ in range(100000):
      bs | bs
@scott-griffiths
Copy link
Owner Author

This is already partly addressed in the work for the 4.2 release. Worth profiling the difference again though.

@scott-griffiths
Copy link
Owner Author

This is considerably better in 4.2.3. It's still slow relatively, mainly due to the code only really profiling the object creation (it doesn't actually do anything useful). The same code in bitformat is even faster so I think that's a reasonable way to continue optimizations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant