|
From: Benjamin R. <ben...@ou...> - 2013-08-09 16:14:15
|
On Fri, Aug 9, 2013 at 11:15 AM, Martin Mokrejs <mmo...@fo... > wrote: > Hi Ben, > thank your for your comments. OK, here are revised patches. I see a hot > spot > in artist.py where the getattr() calls are too expensive. Actually, those > under > the callable() path. > > Ah, yes... one of the biggest warts in our codebase. Does get_aliases() really get called that often? If so, I doubt changes with regards to startwith() is the best use of our time. I would imagine that a refactor that caches possible aliases. Hell, I would just as soon like to see the entire aliases framework ripped out and redone more correctly in the first place. As for the other startswith() changes, there are some subtle differences in the change that has to be considered. First, is there a guarantee that the string being indexed is not empty? startswith() would handle that correctly, while indexing would throw an exception (and setting up code to try...catch those exceptions would reduce readability and probably reduce performance back to where we started). I think that the *biggest* improvement we are going to get is from your patch to figure.py because it touches on some very deep code that is executed very frequently, and we were doing in probably the most inefficient manner. Again, I really stress the importance of setting up a github account and submitting a PR. Once you do that, you are all set to go for contributing to many other great projects (numpy, scipy, ipython, etc.). Cheers! Ben Root |