Commit fd115f4
authored
This reduces TTFX in `Diagonal` - triangular multiplications.
```julia
julia> using Random, LinearAlgebra
julia> A = rand(4,4); U = UpperTriangular(A); D = Diagonal(A);
julia> @time D * U;
0.131110 seconds (239.39 k allocations: 12.162 MiB, 99.95% compilation time) # master
0.102569 seconds (227.44 k allocations: 11.472 MiB, 99.94% compilation time) # this PR
```
If the `Diagonal` is on the right, the TTFX is almost identical, but
allocations go down slightly.
```julia
julia> @time U * D;
0.125025 seconds (221.82 k allocations: 11.252 MiB, 99.95% compilation time) # master
0.127002 seconds (215.59 k allocations: 10.938 MiB, 12.06% gc time, 99.95% compilation time) # this PR
```
1 parent e30c9c3 commit fd115f4
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
| 473 | + | |
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
484 | 484 | | |
485 | | - | |
| 485 | + | |
486 | 486 | | |
487 | 487 | | |
488 | 488 | | |
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
| 514 | + | |
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
| |||
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | | - | |
| 550 | + | |
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| |||
0 commit comments