-
Notifications
You must be signed in to change notification settings - Fork 70
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
Significant slowdown in find / findall for some cases since version 4.1. #326
Comments
Hi. Thanks for the report. The move to using bitarray has made my (limited) performance tests run significantly faster, including a test with I've never tested it in a docker container though - more information would be useful. Obviously if you have a code example that demonstrates the problem that would be best, but otherwise:
My best bet, as this is only happing in Docker, is that you're using a file-based bitstring (a
Thanks. |
Hi. Here are some more details that might help. I don't believe it is a docker issue. It was noticed in docker only because the latest version of bitstring was being used there. The same speed differences have been noticed locally when upgrading and downgrading between 4.0.2 and 4.2.1 also when timing a single
Where
Timings for a single -- Using bitstring 4.0.2 Using bitstring 4.2.1 -- Using bitstring 4.0.2 Using bitstring 4.2.1 |
Ah thanks, that does look like a bigger problem. I'll try to reproduce it when I get a chance, but possibly if you change from a |
I've run some tests on findall, and I can reproduce the issue. Test 1: bytealigned = True, finding whole byte Test 2: bytealigned = True, finding non-whole byte Test 3: bytealigned = False, finding whole byte Test 4: bytealigned = False, finding non-whole byte So for three of the four cases the new bitstring version is ~15x faster. For the other case the old bitstring is ~7x faster. I'm assuming that your case is finding a whole-byte bitstring, so it's the case that has been made slower (you have much worse than 7x slow down, but I'm sure it's the same issue). I'm pretty sure I know what's happened here, and it should be fixable for the 4.2.2 release. |
The new code is 2 or 3x faster than the 4.0.2 code on my machine, rather than 7x slower, so hopefully it should speed up your case. Planning a point release this weekend if possible. |
bitstring 4.2.2 is now released. 🎉 |
Can confirm it slightly faster on average than 4.0.2 in our use-case 👍 |
After updating bitstring to 4.2.1 in a docker based project we started seeing a massive speed decrease.
Scripts went from running in ~6 seconds to well over 4 minutes. Downgrading to 4.0.2 resolved the issue.
All versions since 4.1 in which bitstring uses bitarray are significantly slower for findall().
This issue was only present in docker containers (I tried many different images) - on a host machine or VPS it ran at normal speed.
I'm not sure if this is a bitstring ot bitarray problem, but thought I'd report it here.
The text was updated successfully, but these errors were encountered: