-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
ConfigParser load speedup #51362
Comments
Current implementation (r71564) uses "'%s\n%s' % (old_val, new_line)" to Attached patch against r71564 fixes this problem by first building a We have witnessed a reduction from 4 hours to 3 seconds loading time |
Won't happen for Python 2.x but the idea is good. The original patch won't apply for Py3k so I implemented this approach from scratch for Python 3.2. Patch included. Some microbenchmarks of mine show:
Brett, a quick summary of changes:
|
@Łukasz: I patched the unit test file only and ran it and all tests passed, I assume that this behaviour is incorrect. |
Thanks, Mark. The tests should pass for both the old version and the patched one. The change in the code involves performance, not functionality. I didn't want to set assertions that are time based so naturally the new test also runs on the old implementation. The thing is that it runs slower. |
Łukasz in that case I think we should get this committed as the patch is small and looks clean. I assume that this will be backported as 2.7 and 3.1 are likely to be around for some years yet. |
In msg111399 I remarked the new itertools dependency. It seems it is in fact problematic because when building Python from scratch Attached a new patch that doesn't include itertools dependencies. The only difference with the last one is: 96d95
|
Patch from py3k root. Some minor formatting changes suggested by Ezio Melotti included. |
Committed to py3k in r83154 and release27-maint in r83155. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: