Skip to content

Commit e9fa7f9

Browse files
committed
Update benchmarks.jl
fix benchmarks
1 parent 21bf0f2 commit e9fa7f9

1 file changed

Lines changed: 3 additions & 17 deletions

File tree

benchmark/benchmarks.jl

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,7 @@ function ancestors_workload(nodes, reps::Int)
8888
return s
8989
end
9090

91-
function ancestors_workload_inplace_1(nodes, reps::Int)
92-
s = 0.0
93-
@inbounds for _ in 1:reps
94-
for n in nodes
95-
out = ancestors!(n, :mass, recursivity_level=4, type=Float64)
96-
for v in out
97-
s += v
98-
end
99-
end
100-
end
101-
return s
102-
end
103-
104-
function ancestors_workload_inplace_2(nodes, reps::Int)
91+
function ancestors_workload_inplace(nodes, reps::Int)
10592
s = 0.0
10693
buf = Float64[]
10794
@inbounds for _ in 1:reps
@@ -130,7 +117,7 @@ end
130117

131118
function descendants_extraction_workload_inplace_2(root)
132119
vals = Float64[]
133-
descendants!(vals, root, :mass, type=Float64)
120+
descendants!(vals, root, :mass)
134121
end
135122

136123
suite_name = "mstg"
@@ -163,8 +150,7 @@ SUITE[suite_name]["many_queries"]["parent_repeated"] = @benchmarkable parent_wor
163150
SUITE[suite_name]["many_queries"]["ancestors_repeated"] = @benchmarkable ancestors_workload($leaves, 40)
164151
# Test if ancestors! exists in the package first:
165152
if isdefined(MultiScaleTreeGraph, :ancestors!)
166-
SUITE[suite_name]["many_queries"]["ancestors_repeated_inplace_1"] = @benchmarkable ancestors_workload_inplace_1($leaves, 40)
167-
SUITE[suite_name]["many_queries"]["ancestors_repeated_inplace_2"] = @benchmarkable ancestors_workload_inplace_2($leaves, 40)
153+
SUITE[suite_name]["many_queries"]["ancestors_repeated_inplace"] = @benchmarkable ancestors_workload_inplace(leaves, 40)
168154
end
169155

170156
if abspath(PROGRAM_FILE) == @__FILE__

0 commit comments

Comments
 (0)