-
Notifications
You must be signed in to change notification settings - Fork 131
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
Version 2.0.0 significantly slower #152
Comments
Definitely not expected. Thanks for reporting. IIRC we merged some contributions around nested exception handling, which could be the culprit. I can't think of anything else. @psinger are you able to pinpoint the issue please? Or at least provide a minimal reproducible example. |
@piskvorky Yes, sure, so you can run for example:
Runtime for version 1.7.0:
Runtime for version 2.0.0:
|
Oh wow, that's a huge regression. The CPU times look similar but the wall time exploded. Thanks again for reporting. Are you able to look into it? The surface of changes between 1.7 and 2.0 is pretty small, so hopefully that's not too hard. We might have to revert some commits and make a bugfix release. |
Sorry, I will not have time to look into it, I migrated back to 1.7.0 for the time being. |
OK, reproduced on MacOS Python 3.9:
I'll run a bisection and see what commit caused this. |
I think I've found the commit that caused the problem, now trying to work out why something so trivial is causing such a performance regression:
|
That's just variable renaming....sounds unlikely it could cause any issues. |
Nah, look at how that variable is being used. There's a sleep loop that depends on it. |
Right, but before it was called |
It's not quite the same functionality, because the superclass defines that variable and changes its value as it sees fit.
|
Basically, the problem itself isn't the commit in question. The problem is the way that sqlitedict is attempting to handle a race condition. The commit merely unmasks the problem. I suspect that because that race condition handling has been effectively disabled prior to the commit, the race condition may not be such a big deal after all. I'll have to think about it some more, but I think I see what's going on here. |
Is the sleep necessary? Just removing it could fix the issue. But right, I guess the sleep tries to avoid the race condition. |
Interestingly, cannot reproduce on Py3.9 Linux:
|
Use synchronization primitives instead of sleeping. This eliminates the need for the timeout parameter. The affected class is effectively internal, so this "should" not affect regular users. Also fixed the tests: they didn't clean up after themselves. Added benchmarks. Fixes #152
Took me some time to find the culprit, but after upgrading to sqlitedict
2.0.0
the writing is significantly slower.I am writing with:
Is this expected due to some new functionality?
The text was updated successfully, but these errors were encountered: