Closed
Description
This is expected, but I think it can be optimized.
julia> @btime clamp!($(rand(N0f8, 512, 512)), 0.1, 0.9);
813.628 μs (0 allocations: 0 bytes)
julia> @btime clamp!($(rand(N0f8, 512, 512)), 0.1N0f8, 0.9N0f8);
628.583 μs (0 allocations: 0 bytes)
julia> @btime clamp.($(rand(N0f8, 512, 512)), 0.1, 0.9);
691.843 μs (3 allocations: 2.00 MiB)
julia> @btime clamp.($(rand(N0f8, 512, 512)), 0.1N0f8, 0.9N0f8);
1.146 ms (3 allocations: 256.19 KiB)
Ref: observed in JuliaImages/ImageContrastAdjustment.jl#28 (comment)
Metadata
Metadata
Assignees
Labels
No labels