Skip to content

use numpy.finfo instead of numpy.MachAr for speedup - #4828

Closed
rabryan wants to merge 1 commit into
matplotlib:masterfrom
rabryan:finfo-speedup
Closed

rabryan wants to merge 1 commit into
matplotlib:masterfrom
rabryan:finfo-speedup

Conversation

@rabryan

@rabryan rabryan commented Jul 30, 2015

Copy link
Copy Markdown

numpy.MachAr() is expensive to use just to determine
min/max float value; use numpy.finfo() instead since
it caches this information. This results in
significant performance gains when updating axes limits
frequently.

numpy.MachAr is expensive to use just to determine
min/max float value; use numpy.finfo instead since
it caches this information.   This results in
significant performance gains when updating axes limits
frequently.
@mdboom

mdboom commented Jul 30, 2015

Copy link
Copy Markdown
Member

#4813 is definitely related to this (it just caches the result of MachAr itself). Not sure if one approach is preferable over the other...

@rabryan

rabryan commented Jul 30, 2015

Copy link
Copy Markdown
Author

Ah I missed that pull request. Yeah that way is probably slightly faster since it avoids creating a temporary object...

@rabryan rabryan closed this Jul 30, 2015
@jrevans jrevans mentioned this pull request Aug 17, 2015
14 of 17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants