On Fri, Jul 2, 2010 at 12:10 PM, Christoph Gohlke <cgoh...@uci.edu> wrote: > Hello, > > may I suggest two enhancements for the upcoming matplotlib 1.0 release. > > The first is related to bug #3011650 and fix r8379. > http://matplotlib.svn.sourceforge.net/viewvc/matplotlib?view=revision&revision=8379 > > Texmanager.py, which is imported during the import of matplotlib, does call > subprocess.Popen('dvipng'...) on every import. This can significantly add to > the startup time of scripts. Given that most scripts don't use TeX, can the > Popen() call be deferred to runtime? On my system (Python 2.6 for Windows, > mpl 1.0rc1, MiKTeX 2.8) the 'backend_driver.py agg' tests are run about 8% > (20s) faster with the following patch. > > Index: lib/matplotlib/texmanager.py > =================================================================== > --- lib/matplotlib/texmanager.py (revision 8481) > +++ lib/matplotlib/texmanager.py (working copy) > @@ -91,7 +91,7 @@ > if not os.path.exists(texcache): > os.mkdir(texcache) > > - _dvipng_hack_alpha = dvipng_hack_alpha() > + _dvipng_hack_alpha = None > > # mappable cache of > rgba_arrayd = {} > @@ -516,6 +516,8 @@ > if rcParams['text.dvipnghack'] is not None: > hack = rcParams['text.dvipnghack'] > else: > + if self._dvipng_hack_alpha is None: > + self._dvipng_hack_alpha = dvipng_hack_alpha() > hack = self._dvipng_hack_alpha > > if hack: >
patch 1 is entirely reasonable and harmless so I committed it to trunk JDH ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users