MAINT: Disable use_hugepages in case of ValueError#16708
Conversation
|
It's good to put |
|
Thanks @charris ! |
numpy/__init__.py
Outdated
There was a problem hiding this comment.
Maybe it's worth adding a comment here to explain why the try/except is necessary (perhaps referencing the issue)? A little context might help a future reader understand why it was structured this way.
There was a problem hiding this comment.
thanks for the feedback @rossbar. i have added a comment here.
98f9243 to
e29f5d8
Compare
|
Tried to time it, and its possible that importing LooseVersion adds so little overhead that it would not matter. But, I suppose the try/except is maybe better in any case, just to be on the safe side, and it is not like we should be missing a significant portion of platforms. |
In accordance with this comment: #16679 (comment) , adding try except and setting use_hugepages to 0 in case of ValueError, since the additional LooseVersion import increases the import time a bit. From my measurement, it is more than 1 ms increase in import time.
Closes #16679.
EDIT: distutils import is more than 1 ms increase in import time.