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
Treat real transposes like adjoint in internal dispatch (#1296)
Since real transposes are equivalent to adjoints, we may compile methods
only for one of the two types when we are unwrapping a `Transpose`
through the `wrapperop` mechanism. This will improve the time to the
second execution in certain cases (as the same type will be re-used).
This is primarily useful in internal method dispatches where the result
of `wrapperop` will not be returned.
For example, on master
```julia
julia> using LinearAlgebra
julia> U = UpperTriangular([1 2; 3 4]);
julia> @time transpose(U) * parent(U);
0.140280 seconds (552.81 k allocations: 27.080 MiB, 99.90% compilation time)
julia> @time adjoint(U) * parent(U);
0.124338 seconds (404.18 k allocations: 19.600 MiB, 99.92% compilation time)
```
whereas, on this PR,
```julia
julia> @time transpose(U) * parent(U);
0.161032 seconds (553.25 k allocations: 27.090 MiB, 8.75% gc time, 99.91% compilation time)
julia> @time adjoint(U) * parent(U);
0.053536 seconds (356.69 k allocations: 17.240 MiB, 99.81% compilation time)
```
The second execution is noticeably faster.
0 commit comments