# Outperformed by Matlab

**URL:** https://discourse.julialang.org/t/outperformed-by-matlab/71603
**Category:** Performance
**Tags:** matlab, multithreading, linearalgebra, tullio, loopvectorization
**Created:** [November 16, 2021, 5:58pm UTC](https://discourse.julialang.org/t/outperformed-by-matlab/71603 "2021-11-16T17:58:00Z")
**Posts on this page:** 1
**Showing post:** 8

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [November 16, 2021, 9:22pm UTC](https://discourse.julialang.org/t/outperformed-by-matlab/71603/8 "2021-11-16T21:22:17Z")

</div>

> [@artkuo](#):
>
> Is there a reason not to do `w = X\y` ? For both languages, that should use QR to do linear least squares automatically, and be faster than setting up `X'X` . I

QR (used by `X \ y`) isn’t generally faster than the normal equations (it has the same complexity, but a worse constant factor). But it’s more accurate in general, sometimes _much_ more accurate (if `X` is badly conditioned). See [Efficient way of doing linear regression - #33 by stevengj](https://discourse.julialang.org/t/efficient-way-of-doing-linear-regression/31232/33)

---

_[View the full topic](https://discourse.julialang.org/t/outperformed-by-matlab/71603)._
