Commit 1539390
authored
The performance improvement in `ldiv!` is best seen using
`SparseArrays`, as this seems to lack a specialized `ldiv!` method
currently:
```julia
julia> D = Diagonal(rand(3000));
julia> S = sprand(size(D,1), 0.01);
julia> @Btime ldiv!($D, $S);
29.620 μs (0 allocations: 0 bytes) # master
15.388 μs (22 allocations: 154.47 KiB) # This PR
```
This is because the broadcasting method is taken. Unfortunately, in this
example, the in-place broadcasting for a sparse array is allocating, but
this should be allocation-free in general.
1 parent 4635c5e commit 1539390
1 file changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
615 | | - | |
| 615 | + | |
616 | 616 | | |
617 | 617 | | |
618 | | - | |
| 618 | + | |
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
643 | | - | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
644 | 654 | | |
645 | 655 | | |
646 | 656 | | |
| |||
0 commit comments