Skip to content

Commit 7ba498d

Browse files
committed
Include benchmark of is_bad_array
1 parent d94339b commit 7ba498d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

benchmark/benchmarks.jl

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using DynamicExpressions, BenchmarkTools, Random
22
using DynamicExpressions.EquationUtilsModule: is_constant
3+
using DynamicExpressions.UtilsModule: is_bad_array
34

45
include("benchmark_utils.jl")
56

@@ -115,7 +116,7 @@ end
115116
f_tree_op(f::F, tree, operators) where {F} = f(tree, operators)
116117
f_tree_op(f::F, tree) where {F} = f(tree)
117118

118-
function benchmark_utilities()
119+
function tree_utilities()
119120
suite = BenchmarkGroup()
120121

121122
all_funcs = (
@@ -171,6 +172,20 @@ function benchmark_utilities()
171172
s
172173
end
173174
end
175+
return suite
176+
end
177+
178+
function benchmark_utilities()
179+
suite = BenchmarkGroup()
180+
181+
suite["trees"] = tree_utilities()
182+
suite["extra"] = let s = BenchmarkGroup()
183+
f(Xs) = [is_bad_array(X) for X in Xs]
184+
s["is_bad_array"] = @benchmarkable(
185+
f(Xs), setup = (Xs = ntuple(n -> randn(Float64, 10_000 + n), 16))
186+
)
187+
s
188+
end
174189

175190
return suite
176191
end

0 commit comments

Comments
 (0)