[issue7113] ConfigParser load speedup

2009-10-12 Thread albert hofkamp
New submission from albert hofkamp : Current implementation (r71564) uses "'%s\n%s' % (old_val, new_line)" to merge multi-line options into one string. For options with many lines, this wastes a lot of CPU power. Attached patch against r71564 fixes this problem by first building a list of lines

[issue7113] ConfigParser load speedup

2010-07-23 Thread Łukasz Langa
Łukasz Langa added the comment: 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: - a 3-5% slowdown for very small files (we can ignore this s

[issue7113] ConfigParser load speedup

2010-07-24 Thread Mark Lawrence
Mark Lawrence added the comment: @Łukasz: I patched the unit test file only and ran it and all tests passed, I assume that this behaviour is incorrect. -- nosy: +BreamoreBoy stage: -> patch review ___ Python tracker

[issue7113] ConfigParser load speedup

2010-07-24 Thread Łukasz Langa
Łukasz Langa added the comment: 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

[issue7113] ConfigParser load speedup

2010-07-24 Thread Mark Lawrence
Mark Lawrence added the comment: Ł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. -- ___ Python tracker

[issue7113] ConfigParser load speedup

2010-07-25 Thread Łukasz Langa
Łukasz Langa added the comment: In msg111399 I remarked the new itertools dependency. It seems it is in fact problematic because when building Python from scratch `setup.py` which is used to build C extensions is using configparser. And one of the C-only modules is itertools :) Attached a ne

[issue7113] ConfigParser load speedup

2010-07-25 Thread Łukasz Langa
Changes by Łukasz Langa : Removed file: http://bugs.python.org/file18200/issue7113_without_itertools.diff ___ Python tracker ___ ___ Python-bug

[issue7113] ConfigParser load speedup

2010-07-25 Thread Łukasz Langa
Łukasz Langa added the comment: Patch from py3k root. Some minor formatting changes suggested by Ezio Melotti included. -- Added file: http://bugs.python.org/file18204/issue7113_without_itertools.diff ___ Python tracker

[issue7113] ConfigParser load speedup

2010-07-25 Thread Brian Curtin
Brian Curtin added the comment: Committed to py3k in r83154 and release27-maint in r83155. -- nosy: +brian.curtin resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker