Skip to content

Commit

Permalink
add high dimensional setindex! benchmarks (ref JuliaLang/julia#9622)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrevels committed Jan 28, 2016
1 parent 1fd2ed7 commit 35a88ca
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/arrays/ArrayBenchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,20 @@ include("revloadindex.jl")
@tags "array" "indexing" "load" "reverse"
end

# #9622 #
#-------#

perf_setindex!(A, val, inds) = setindex!(A, val, inds...)

@track BaseBenchmarks.TRACKER "array index setindex!" begin
@setup arrays = map(n -> Array(Float64, ntuple(one, n)), (1,2,3,4,5))
@benchmarks begin
[(:setindex!, ndims(A)) => perf_setindex!(A, one(eltype(A)), size(A)) for A in arrays]
end
@constraints gc=>false
@tags "array" "indexing" "setindex!"
end

###############################
# SubArray (views vs. copies) #
###############################
Expand Down

0 comments on commit 35a88ca

Please sign in to comment.