Closed mkitti closed 2 years ago
Proposed usage may look like this:
julia> @time ArrayAllocators.zeros(Int, 3200, 3200);
0.000026 seconds (4 allocations: 78.125 MiB)
julia> @time Base.zeros(Int, 3200, 3200);
0.133595 seconds (2 allocations: 78.125 MiB, 67.36% gc time)
julia> ArrayAllocators.zeros(Int, 256, 256) == Base.zeros(Int, 256, 256)
true
It should be possible to also import ArrayAllocators.zeros
if Base.zeros
has not been used already.
From #7 it seems there may be an expectation for this package to implement a new version of
zeros
based oncalloc
that can be used a drop in replacement forBase.zeros
.I am somewhat reluctant to add this since the
Array{T}(...)
syntax is preferred. However, perhaps some will find this useful.