Skip to content

Commit 79af57c

Browse files
committed
fix update?() and add update?_eachindex().
1 parent f77f7a7 commit 79af57c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

benchmark/benchmarks.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,15 @@ y = OffsetArray(Float64, -dim + 1 : dim)
88

99
fillx() = for i = 1:2*dim x[i] = i end
1010
filly() = for i = -dim+1:dim y[i] = i end
11-
updatex() = for i = 1:2*dim x[i] = i end
12-
updatey() = for i = -dim+1:dim y[i] = i end
11+
updatex() = for i = 1:2*dim x[i] = x[i] + i end
12+
updatey() = for i = -dim+1:dim y[i] = y[i] + i end
13+
updatex_eachindex() = for i in eachindex(x) x[i] + i end
14+
updatey_eachindex() = for i in eachindex(y) y[i] = y[i] + i end
1315

14-
@benchmark fillx()
16+
@benchmark fillx()
1517
@benchmark filly()
16-
@benchmark updatex()
18+
@benchmark updatex()
1719
@benchmark updatey()
20+
@benchmark updatex_eachindex()
21+
@benchmark updatey_eachindex()
1822

0 commit comments

Comments
 (0)