On Mon, Sep 20, 2010 at 6:04 PM, Dieter Weber <die...@uellue.de> wrote: > Hi, > I'm currently working on speeding up the legend rendering of matplotlib > as this turns out to be a bottleneck for my application. With some > tracing and profiling, I found that > matplotlib.__init__.RcParams.__getitem__() makes up around 10% of the > total function calls (by number) in my little test program. It is called > continuously all over the matplotlib code, whenever a configuration > parameter is accessed. > > Therefore removed the __getitem__ method and moved the key validation to > a newly written __init__ function, so that validation only happens once > the object is created, and otherwise the native lookup of the dict() > class is used. This made my program around 10% faster! :-) > > The diff ("svn diff") is appended. If you are interested in the > profiling results (not only regarding this piece of code), please let me > know!
First glance looks alright to me, though I haven't looked in heavy detail. I will defer, however, to those much more familiar with this code. Thanks for the patch, Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma ------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev _______________________________________________ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel