-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use dedicated 3-way sort Arrays.sort carries overhead because it's generalised. But we know precisely the case here, which is always a 3-element array. Profiling shows that while assigning ellipsoid IDs most (98% !) of the time is spent in getSortedRadii(). This dedicated 3-way sort is about 2× faster than Arrays.sort in a basic performance test. * Reduce slow methods a bit more * getSortedRadii() and Math.max() are similar speed But the result is needed twice (for min and max) so getSortedRadii() is better here. * formatting
- Loading branch information
Showing
3 changed files
with
63 additions
and
25 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
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
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