Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Low-hanging performance improvements #5664
Conversation
mdboom
added the
needs_review
label
Dec 11, 2015
mdboom
added some commits
Dec 12, 2015
|
I think this is finally ready-to-merge. |
tacaswell
commented on the diff
Dec 22, 2015
lib/matplotlib/transforms.py
| @@ -109,14 +106,17 @@ def __str__(self): | ||
| def __getstate__(self): | ||
| d = self.__dict__.copy() | ||
| - # turn the weakkey dictionary into a normal dictionary | ||
| - d['_parents'] = dict(six.iteritems(self._parents)) | ||
| + # turn the dictionary with weak values into a normal dictionary | ||
| + d['_parents'] = dict((k, v()) for (k, v) in |
mdboom
Owner
|
tacaswell
added this to the
proposed next point release (2.1)
milestone
Dec 22, 2015
tacaswell
added a commit
that referenced
this pull request
Dec 22, 2015
|
|
tacaswell |
50ce5ff
|
tacaswell
merged commit 50ce5ff
into matplotlib:master
Dec 22, 2015
tacaswell
removed the
needs_review
label
Dec 22, 2015
pelson
commented on the diff
Jan 6, 2016
lib/matplotlib/markers.py
| @@ -93,6 +93,8 @@ | ||
| (TICKLEFT, TICKRIGHT, TICKUP, TICKDOWN, | ||
| CARETLEFT, CARETRIGHT, CARETUP, CARETDOWN) = list(xrange(8)) | ||
| +_empty_path = Path(np.empty((0, 2))) |
pelson
Member
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mdboom commentedDec 11, 2015
Instantiating Paths is expensive, but they aren't mutable, so just reuse
when possible.
WeakValueDictionaries are expensive to construct. We can fix that by
handling the weakrefs ourself.
And
cbook.popallhas no reason to exist. Maybe someone's using it and it should stay, but no one should be using it.On my benchmark of:
I get a speedup from 5.04s to 3.81s.