6 ms·
ESR mentioned in a comment [1] that he hadn't profiled the Python code in years, which would have been a sensible first step if he's concerned with performance.
by ptx 3y ago
ESR mentioned in a comment [1] that he hadn't profiled the Python code in years, which would have been a sensible first step if he's concerned with performance. I suspect there were parts that could have been improved.
Maybe all those debug logging statements in the last Python version [2] that, unlike the built-in logging framework, use the string formatting operator to construct the log message regardless of whether debug logging is enabled.
I can't imagine that encoding everything to latin-1 as a workaround for Unicode support is very good for performance either, unless he was only using the Python 2 version.
And maybe, for example, the empty_comment function doesn't need to call the str.strip method twice on the same string? Maybe that could be more efficient?
[1] http://esr.ibiblio.org/?p=8161&cpage=1#comment-2065946 http://esr.ibiblio.org/?p=8161&cpage=1#comment-2065946
[2] https://gitlab.com/esr/reposurgeon/-/blob/911d5c1168f7839855b577ea43971c7c35cacef8/reposurgeon https://gitlab.com/esr/reposurgeon/-/blob/911d5c1168f7839855...
- Qem 3y agoIIRC, late in the port he reported they quashed some previously unknown O(n^2) bottlenecks. Backporting those fixes would surely help.