Commit d21ad8c
authored
Matrix constructor for triangular (#1282)
This reduces TTFX as well as improves performance. This is because we
add specialized functions to avoid the branches in `getindex` for a
triangular matrix.
```julia
julia> using LinearAlgebra
julia> U4 = UpperTriangular(ones(4,4));
julia> @time Array(U4); # TTFX
0.087534 seconds (193.27 k allocations: 9.706 MiB, 99.88% compilation time) # nightly
0.049869 seconds (91.45 k allocations: 4.531 MiB, 99.78% compilation time) # this PR
julia> U = UpperTriangular(ones(2000,2000));
julia> @Btime Array($U);
3.205 ms (3 allocations: 30.52 MiB) # master
2.764 ms (3 allocations: 30.52 MiB) # this PR
```1 parent dcf579c commit d21ad8c
2 files changed
+42
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2092 | 2092 | | |
2093 | 2093 | | |
2094 | 2094 | | |
| 2095 | + | |
| 2096 | + | |
2095 | 2097 | | |
2096 | | - | |
2097 | | - | |
2098 | 2098 | | |
2099 | 2099 | | |
2100 | 2100 | | |
2101 | 2101 | | |
| 2102 | + | |
| 2103 | + | |
2102 | 2104 | | |
2103 | | - | |
2104 | | - | |
2105 | 2105 | | |
2106 | 2106 | | |
2107 | 2107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
155 | 161 | | |
156 | 162 | | |
157 | 163 | | |
| |||
622 | 628 | | |
623 | 629 | | |
624 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
625 | 657 | | |
626 | 658 | | |
627 | | - | |
628 | 659 | | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
634 | 663 | | |
635 | 664 | | |
636 | 665 | | |
637 | 666 | | |
638 | 667 | | |
639 | 668 | | |
640 | | - | |
641 | 669 | | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
| 670 | + | |
| 671 | + | |
647 | 672 | | |
| 673 | + | |
648 | 674 | | |
649 | 675 | | |
650 | 676 | | |
| |||
0 commit comments