Closed devmotion closed 11 months ago
This PR removes the sqrt computations and permutedims calls from the tri product implementations for PDiagMat.
sqrt
permutedims
PDiagMat
julia> using PDMats, BenchmarkTools julia> a = PDiagMat(rand(10)); X = randn(10, 10); julia> @btime Xt_A_X(a, X); 366.343 ns (2 allocations: 1.75 KiB) julia> @btime X_A_Xt(a, X); 377.044 ns (4 allocations: 1.84 KiB) julia> @btime Xt_invA_X(a, X); 394.279 ns (2 allocations: 1.75 KiB) julia> @btime X_invA_Xt(a, X); 404.580 ns (4 allocations: 1.84 KiB) julia> a = PDiagMat(rand(100)); X = randn(100, 100); julia> @btime Xt_A_X(a, X); 48.125 μs (4 allocations: 156.34 KiB) julia> @btime X_A_Xt(a, X); 46.333 μs (6 allocations: 156.44 KiB) julia> @btime Xt_invA_X(a, X); 52.667 μs (4 allocations: 156.34 KiB) julia> @btime X_invA_Xt(a, X); 49.166 μs (6 allocations: 156.44 KiB)
julia> using PDMats, BenchmarkTools julia> a = PDiagMat(rand(10)); X = randn(10, 10); julia> @btime Xt_A_X(a, X); 252.231 ns (2 allocations: 1.75 KiB) julia> @btime X_A_Xt(a, X); 261.102 ns (2 allocations: 1.75 KiB) julia> @btime Xt_invA_X(a, X); 252.301 ns (2 allocations: 1.75 KiB) julia> @btime X_invA_Xt(a, X); 264.350 ns (2 allocations: 1.75 KiB) julia> a = PDiagMat(rand(100)); X = randn(100, 100); julia> @btime Xt_A_X(a, X); 38.916 μs (4 allocations: 156.34 KiB) julia> @btime X_A_Xt(a, X); 41.792 μs (4 allocations: 156.34 KiB) julia> @btime Xt_invA_X(a, X); 40.542 μs (4 allocations: 156.34 KiB) julia> @btime X_invA_Xt(a, X); 40.667 μs (4 allocations: 156.34 KiB)
All modified lines are covered by tests :white_check_mark:
97.47% <100.00%> (ø)
:loudspeaker: Thoughts on this report? Let us know!.
This PR removes the
sqrt
computations andpermutedims
calls from the tri product implementations forPDiagMat
.master
This PR