-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
speeded up slice creation by omission of min/max calls
Direct if-statements are 4-5 times faster since we can omit the min+max calls Signed-off-by: Nick Papior <nickpapior@gmail.com>
- Loading branch information
Showing
1 changed file
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c522040
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this makes it very hard to read, is the performance gain significant?
c522040
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know, it kind of looks horrible, it is around 5 times faster (each
min/max
invocation).I thought this was an ok thing, what I forgot to benchmark against was numpy calls.. I just suspected the array creation to be too large.
c522040
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But is the timing relevant with respect to the whole orbital values computing function?
c522040
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you are right... I would assume for coarse grids with bulk things this might be important...