72
72
# "bench_ufunc",
73
73
]
74
74
75
+ SKIPPED_NUMPY_BENCHMARKS = [
76
+ "bench_core.CountNonzero.time_count_nonzero(3, 1000000, <class 'str'>)" , # Times out
77
+ "bench_core.CountNonzero.time_count_nonzero_axis(3, 1000000, <class 'str'>)" , # Times out
78
+ "bench_core.CountNonzero.time_count_nonzero_multi_axis(3, 1000000, <class 'str'>)" , # Times out
79
+ "bench_linalg.LinalgSmallArrays.time_det_small_array" , # TODO fails with numpy.linalg.LinAlgError
80
+ ]
81
+
75
82
DEFAULT_PANDAS_BENCHMARKS = [
76
83
"reshape" ,
77
84
"replace"
78
85
]
79
86
87
+ SKIPPED_PANDAS_BENCHMARKS = [
88
+ "replace.ReplaceDict.time_replace_series" , # Times out
89
+ "replace.ReplaceList.time_replace_list" , # OOM, WIP msimacek
90
+ "replace.ReplaceList.time_replace_list_one_match" , # OOM, WIP msimacek
91
+ "reshape.Crosstab.time_crosstab_normalize_margins" , # Times out
92
+ "reshape.Cut.peakmem_cut_interval" , # Times out
93
+ "reshape.Cut.time_cut_interval" , # Times out
94
+ "reshape.GetDummies.time_get_dummies_1d_sparse" , # Times out
95
+ "reshape.PivotTable.time_pivot_table_margins" , # Times out
96
+ "reshape.WideToLong.time_wide_to_long_big" , # Times out
97
+ ]
98
+
80
99
DEFAULT_PYPERFORMANCE_BENCHMARKS = [
81
100
# "2to3",
82
101
# "chameleon",
173
192
]
174
193
175
194
195
+ def create_asv_benchmark_selection (benchmarks , skipped = ()):
196
+ regex = '|' .join (benchmarks )
197
+ if not skipped :
198
+ return regex
199
+ negative_lookaheads = [re .escape (skip ) + (r'\b' if not skip .endswith (')' ) else '' ) for skip in skipped ]
200
+ return '^(?!' + '|' .join (negative_lookaheads ) + ')(' + regex + ')'
201
+
202
+
176
203
class PyPerfJsonRule (mx_benchmark .Rule ):
177
204
"""Parses a JSON file produced by PyPerf and creates a measurement result."""
178
205
@@ -731,10 +758,8 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
731
758
[join (workdir , vm_venv , "bin" , "asv" ), "machine" , "--yes" ], cwd = benchdir
732
759
)
733
760
734
- if benchmarks :
735
- bms = ["-b" , "|" .join (benchmarks )]
736
- else :
737
- bms = ["-b" , "|" .join (DEFAULT_NUMPY_BENCHMARKS )]
761
+ if not benchmarks :
762
+ benchmarks = DEFAULT_NUMPY_BENCHMARKS
738
763
retcode = mx .run (
739
764
[
740
765
join (workdir , vm_venv , "bin" , "asv" ),
@@ -745,7 +770,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
745
770
"--python=same" ,
746
771
"--set-commit-hash" ,
747
772
self .VERSION ,
748
- * bms ,
773
+ "-b" , create_asv_benchmark_selection ( benchmarks , skipped = SKIPPED_NUMPY_BENCHMARKS ) ,
749
774
],
750
775
cwd = benchdir ,
751
776
nonZeroIsFatal = False ,
@@ -860,10 +885,8 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
860
885
[join (workdir , vm_venv , "bin" , "asv" ), "machine" , "--yes" ], cwd = benchdir
861
886
)
862
887
863
- if benchmarks :
864
- bms = ["-b" , "|" .join (benchmarks )]
865
- else :
866
- bms = ["-b" , "|" .join (DEFAULT_PANDAS_BENCHMARKS )]
888
+ if not benchmarks :
889
+ benchmarks = DEFAULT_PANDAS_BENCHMARKS
867
890
retcode = mx .run (
868
891
[
869
892
join (workdir , vm_venv , "bin" , "asv" ),
@@ -874,7 +897,7 @@ def _vmRun(self, vm, workdir, command, benchmarks, bmSuiteArgs):
874
897
"--python=same" ,
875
898
"--set-commit-hash" ,
876
899
self .VERSION_TAG ,
877
- * bms ,
900
+ "-b" , create_asv_benchmark_selection ( benchmarks , skipped = SKIPPED_PANDAS_BENCHMARKS ) ,
878
901
],
879
902
cwd = benchdir ,
880
903
nonZeroIsFatal = False ,
0 commit comments