SF.net SVN: matplotlib: [3744] trunk/matplotlib/lib/matplotlib


Thank you, that's wonderful! I knew dedent was a major speed problem, but I couldn't think of how to speed it up, and to my eye keeping the docstrings properly indented in the code makes a *huge* difference in readability.


mdboom@...189... wrote:


Revision: 3744
Author: mdboom
Date: 2007-08-28 12:17:21 -0700 (Tue, 28 Aug 2007)

Log Message:
Use regular expressions to do dedenting. This is ~15X faster than the
old implementation. dedent accounted for around 30% of the time spent
in "import pylab", so was probably worthy of optimization, even if this
regex approach is less clear. The results are identical to the old
implementation, with the exception of a single docstring (in
backend_bases.py) that needed to be fixed.