-
-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trying to improve performance for NumericQ/NumberQ tests
adding benchmark Negative avoids to call `evaluate(evaluation)` by calling the `Less.sapply` method directly. Positive 'Positive[Sqrt[2]]' 100 loops, avg: 19.7 ms, best: 18.6 ms, median: 19.5 ms per loop 'Positive[Sqrt[-2]]' 100 loops, avg: 31.5 ms, best: 28.9 ms, median: 29.8 ms per loop 'Positive[Sqrt[2.]]' 5000 loops, avg: 949 us, best: 825 us, median: 890 us per loop 'Positive[Sqrt[-2.]]' 5000 loops, avg: 956 us, best: 820 us, median: 887 us per loop 'Positive[q]' 10000 loops, avg: 164 us, best: 141 us, median: 147 us per loop 'Positive["q"]' 10000 loops, avg: 159 us, best: 137 us, median: 143 us per loop Negative 'Negative[Sqrt[2]]' 100 loops, avg: 19.7 ms, best: 18.9 ms, median: 19.5 ms per loop 'Negative[Sqrt[-2]]' 100 loops, avg: 31.8 ms, best: 29.2 ms, median: 30.3 ms per loop 'Negative[Sqrt[2.]]' 5000 loops, avg: 954 us, best: 836 us, median: 901 us per loop 'Negative[Sqrt[-2.]]' 5000 loops, avg: 952 us, best: 832 us, median: 898 us per loop 'Negative[q]' 10000 loops, avg: 165 us, best: 145 us, median: 150 us per loop 'Negative["q"]' 10000 loops, avg: 159 us, best: 140 us, median: 144 us per loop NumericQ 'NumericQ[Sqrt[2]]' 5000 loops, avg: 987 us, best: 863 us, median: 934 us per loop 'NumericQ[Sqrt[-2]]' 1000 loops, avg: 1.68 ms, best: 1.47 ms, median: 1.65 ms per loop 'NumericQ[Sqrt[2.]]' 5000 loops, avg: 917 us, best: 802 us, median: 862 us per loop 'NumericQ[Sqrt[-2.]]' 5000 loops, avg: 948 us, best: 810 us, median: 878 us per loop 'NumericQ[q]' 10000 loops, avg: 81.5 us, best: 71.2 us, median: 73.2 us per loop 'NumericQ["q"]' 10000 loops, avg: 77.2 us, best: 67.8 us, median: 69.6 us per loop fixup: Format Python code with Black Now `expression.is_numeric` accepts an `evaluation` object as an argument and `NumericQ` calls directly that method. Positive 'Positive[Sqrt[2]]' 100 loops, avg: 19.4 ms, best: 18.4 ms, median: 19.2 ms per loop 'Positive[Sqrt[-2]]' 100 loops, avg: 31.5 ms, best: 28.7 ms, median: 29.8 ms per loop 'Positive[Sqrt[2.]]' 5000 loops, avg: 948 us, best: 822 us, median: 890 us per loop 'Positive[Sqrt[-2.]]' 5000 loops, avg: 943 us, best: 813 us, median: 882 us per loop 'Positive[q]' 10000 loops, avg: 160 us, best: 138 us, median: 144 us per loop 'Positive["q"]' 10000 loops, avg: 157 us, best: 133 us, median: 139 us per loop Negative 'Negative[Sqrt[2]]' 100 loops, avg: 19.4 ms, best: 18.3 ms, median: 19.1 ms per loop 'Negative[Sqrt[-2]]' 100 loops, avg: 31.5 ms, best: 28.6 ms, median: 29.6 ms per loop 'Negative[Sqrt[2.]]' 5000 loops, avg: 951 us, best: 813 us, median: 890 us per loop 'Negative[Sqrt[-2.]]' 5000 loops, avg: 928 us, best: 807 us, median: 876 us per loop 'Negative[q]' 10000 loops, avg: 87.2 us, best: 75.9 us, median: 78.4 us per loop 'Negative["q"]' 10000 loops, avg: 84 us, best: 73.4 us, median: 75.7 us per loop NumericQ 'NumericQ[Sqrt[2]]' 1000 loops, avg: 1.01 ms, best: 866 us, median: 942 us per loop 'NumericQ[Sqrt[-2]]' 1000 loops, avg: 1.66 ms, best: 1.45 ms, median: 1.62 ms per loop 'NumericQ[Sqrt[2.]]' 5000 loops, avg: 904 us, best: 787 us, median: 851 us per loop 'NumericQ[Sqrt[-2.]]' 5000 loops, avg: 912 us, best: 794 us, median: 859 us per loop 'NumericQ[q]' 10000 loops, avg: 78 us, best: 69.7 us, median: 71.4 us per loop 'NumericQ["q"]' 10000 loops, avg: 75.5 us, best: 66.2 us, median: 68.3 us per loop listing changes
- Loading branch information
Showing
21 changed files
with
123 additions
and
68 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
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
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
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
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
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
Oops, something went wrong.