Skip to content

Commit 35a88ca

Browse files
committed
add high dimensional setindex! benchmarks (ref JuliaLang/julia#9622)
1 parent 1fd2ed7 commit 35a88ca

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/arrays/ArrayBenchmarks.jl

+14
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ include("revloadindex.jl")
4848
@tags "array" "indexing" "load" "reverse"
4949
end
5050

51+
# #9622 #
52+
#-------#
53+
54+
perf_setindex!(A, val, inds) = setindex!(A, val, inds...)
55+
56+
@track BaseBenchmarks.TRACKER "array index setindex!" begin
57+
@setup arrays = map(n -> Array(Float64, ntuple(one, n)), (1,2,3,4,5))
58+
@benchmarks begin
59+
[(:setindex!, ndims(A)) => perf_setindex!(A, one(eltype(A)), size(A)) for A in arrays]
60+
end
61+
@constraints gc=>false
62+
@tags "array" "indexing" "setindex!"
63+
end
64+
5165
###############################
5266
# SubArray (views vs. copies) #
5367
###############################

0 commit comments

Comments
 (0)