You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you know, Normed multiplication in FixedPointNumbers v0.8 is slow. The performance will be improved in FixedPointNumbers v0.9 (cf. JuliaMath/FixedPointNumbers.jl#213), but there are still some issues to be solved before FixedPointNumbers v0.9 is released.
As mentioned below, the real scaling for RGBs is made faster by specialization for Normed. On the other hand, the multiplication for grays and the new multiplication operator ⊙ use the slow multiplication.
julia>using BenchmarkTools, ColorVectorSpace, ColorTypes, FixedPointNumbers, ColorBlendModes;
julia> a =rand(RGB{N0f8}, 1000, 1000); b =rand(RGB{N0f8}, 1000, 1000);
julia> a .⊙ b ==BlendMultiply.(a, b) # the same operationtrue
julia>@btime$a .⊙$b;
10.084 ms (2 allocations:2.86 MiB)
julia>@btimeBlendMultiply.($a, $b);
881.000 μs (2 allocations:2.86 MiB)
One possible option is just to wait for FixedPointNumbers v0.9, and it's okay for me.
However, there is a problem with the current RGB optimization. The following is a bug which has existed since the initial working commit of ColorVectorSpace.
As you know,
Normed
multiplication in FixedPointNumbers v0.8 is slow. The performance will be improved in FixedPointNumbers v0.9 (cf. JuliaMath/FixedPointNumbers.jl#213), but there are still some issues to be solved before FixedPointNumbers v0.9 is released.As mentioned below, the real scaling for RGBs is made faster by specialization for
Normed
. On the other hand, the multiplication for grays and the new multiplication operator⊙
use the slow multiplication.One possible option is just to wait for FixedPointNumbers v0.9, and it's okay for me.
However, there is a problem with the current RGB optimization. The following is a bug which has existed since the initial working commit of ColorVectorSpace.
ColorVectorSpace.jl/src/ColorVectorSpace.jl
Lines 213 to 216 in 06d70b8
For that reason, I would like to rewrite the implementation of the multiplication, not so much for the performance, but for the code quality.
The text was updated successfully, but these errors were encountered: