# Julia 1.5, 1.6 twice as fast in sparse matrix solve as 1.4.2

**URL:** <https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099>\
**Category:** General Usage\
**Created:** [June 9, 2020, 10:10pm UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099 "2020-06-09T22:10:37Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 9, 2020, 10:10pm UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/1 "2020-06-09T22:10:37Z")

</div>

On Windows 10. Any idea why that would be so?

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [June 9, 2020, 10:32pm UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/2 "2020-06-09T22:32:29Z")

</div>

Is it [Rebase of #28526 on master: Sparse cholesky solve with sparse RHS by ViralBShah · Pull Request #34989 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/34989)? Wait, that appears to be in 1.4.1. Never mind v2, it actually is 1.5 and later.

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [June 9, 2020, 10:37pm UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/3 "2020-06-09T22:37:02Z")

</div>

![Screenshot 2020-06-09 at 23.35.39](https://global.discourse-cdn.com/julialang/original/3X/e/1/e1dad6fcef94ca505975dc089b917737739dd996.png)

Using a trick I learned recently (click on the merge commit and look for the little tag icons), it looks like the only tag it’s been in is v1.5.0-beta1 (not 1.4.1)

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 9, 2020, 11:36pm UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/4 "2020-06-09T23:36:27Z")

</div>

What is this about please? There’s no link 🙂

---

<div class="post-metadata">

**Author:** ![ericphanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericphanson/32/215186_2.png) [@ericphanson](https://discourse.julialang.org/u/ericphanson)\
**Post date:** [June 9, 2020, 11:42pm UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/5 "2020-06-09T23:42:07Z")

</div>

I meant to reply to @Oscar_Smith to say that actually, the pull request he linked didn’t make it into a 1.4 release, so it could explain the performance improvements you noticed.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 10, 2020, 12:07am UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/6 "2020-06-10T00:07:11Z")

</div>

Thanks.  
But, my rhs is not sparse. It is a fully populated vector.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 10, 2020, 1:30am UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/7 "2020-06-10T01:30:56Z")

</div>

Tested with WSL2. Not nearly as pronounced as on Win 10.  
1.4.2 27.8 seconds  
1.5 22.0 seconds  
1.6 25.6 seconds

Win 10:  
1.4.2 29.6 seconds  
1.5 17.1 seconds  
1.6 14.6 seconds

---

<div class="post-metadata">

**Author:** ![robsmith11](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/robsmith11/32/29641_2.png) [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Post date:** [June 10, 2020, 4:51am UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/8 "2020-06-10T04:51:44Z")

</div>

Just a guess, but non-allocating views, which landed in 1.5, sped up quite a few things for me:

> <https://github.com/JuliaLang/julia/issues/14955>
>
> I couldn't find an open issue for this frequently-noted problem, so I'm filing t…his. Feel free to close if there's an earlier one.
> 
> It's worth linking to https://groups.google.com/forum/#!topic/julia-users/6Z1kJ5LrSMU, where it was pointed out that "faking" a view as \`(A, R)\`, where \`R\` is a \`CartesianRange\`, is currently the cleanest way to circumvent this problem (but can only handle the equivalent of \`Int/UnitRange/Colon\` indexes). Various solutions using \`Ptr\` have also been employed in the past, but of course those suffer from the standpoint of garbage-collection safety.

---

<div class="post-metadata">

**Author:** ![paolol](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paolol/32/14624_2.png) [@paolol](https://discourse.julialang.org/u/paolol)\
**Post date:** [June 10, 2020, 7:26am UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/9 "2020-06-10T07:26:00Z")

</div>

I will not trust WSLX, is virtual enviroment in W10 you are directly using the HW no emulation of any sort If you want to compare you have to use Linux fully installed on the same PC.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 10, 2020, 2:35pm UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/10 "2020-06-10T14:35:24Z")

</div>

On a dedicated Linux workstation (x86\_64, plenty of memory):  
1.4.2 42 seconds  
1.5 37 seconds  
1.6 37 seconds

Unfortunately, I have no dual-boot machine. I cannot give relative numbers Windows/Linux. Well, that is with the exception of the Windows/WSL2 comparison above.

---

<div class="post-metadata">

**Author:** ![paolol](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paolol/32/14624_2.png) [@paolol](https://discourse.julialang.org/u/paolol)\
**Post date:** [June 10, 2020, 5:49pm UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/11 "2020-06-10T17:49:02Z")

</div>

It seem that on the Linux machine you have a slower CPU 🙂

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 10, 2020, 5:53pm UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/12 "2020-06-10T17:53:05Z")

</div>

True. It has 64 cores at 1.7 GHz. Slow by today’s standards. But my point was to show how the Julia releases compared on the sparse solve.

---

<div class="post-metadata">

**Author:** ![paolol](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paolol/32/14624_2.png) [@paolol](https://discourse.julialang.org/u/paolol)\
**Post date:** [June 11, 2020, 7:09am UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/13 "2020-06-11T07:09:10Z")

</div>

I understand, from what I see the 1.5 is overall faster than the 1,4.2 , for the 1.6 vs 1.5 don’t think we can have a good compare as the 1.6 is still far to be ready and performance depend too much on the HW you used. But is still good to see the big jump in 1.5 🙂 🙂

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [June 11, 2020, 2:09pm UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099/14 "2020-06-11T14:09:56Z")

</div>

But would that explain the difference btw Win and Linux?
