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

Mike,

After a quick test, I am puzzled: running "backend_driver.py Template"
takes 0.49 minutes on my machine before and after this change, so the dedenting time must have been less than I thought.

Eric

mdboom@...189... wrote:

···

Revision: 3744
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3744&view=rev
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.

Perhaps the difference is below the noise floor? I was focusing only on startup time by running lsprofcalltree over a script containing only "import pylab". In that context, dedent was the largest contributor to startup time (other than stuff in the stdlib and numpy) before this change. But I would imagine that that over the total time of backend_driver.py and actually doing stuff like, say, *plotting* is fairly insignificant.

Cheers,
Mike

Eric Firing wrote:

···

Mike,

After a quick test, I am puzzled: running "backend_driver.py Template"
takes 0.49 minutes on my machine before and after this change, so the dedenting time must have been less than I thought.

Eric

mdboom@...189... wrote:

Revision: 3744
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=3744&view=rev
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.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel