Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

rabryan
Copy link

@rabryan rabryan commented Jul 30, 2015

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
Copy link
Member

mdboom commented Jul 30, 2015

#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
Copy link
Author

rabryan commented Jul 30, 2015

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

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