I thought that inverting a symmetric matrix would be faster, since there are optimised algorithms and I also saw that there is a method explicity for `Symmetric`

, but maybe I am overlooking some trivial things, so please help

This is the method I found with `methods(inv)`

```
[9] inv(A::LinearAlgebra.Symmetric{<:Any, <:StridedMatrix{T} where T}) in LinearAlgebra at /Users/tamasgal/.julia/juliaup/julia-1.8.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.8/LinearAlgebra/src/symmetric.jl:647
```

and in the example below `M`

is a subtype of that `Symmetric`

type:

```
julia> N = 1000; A = rand(N, N); M = Symmetric(A'A);
julia> typeof(M) <: LinearAlgebra.Symmetric{<:Any, <:StridedMatrix{T} where T}
true
```

So why is there no difference between a random matrix and a symmetric one?

```
julia> using BenchmarkTools, LinearAlgebra
julia> N = 100; A = rand(N, N); M = A'A;
julia> @benchmark inv(M)
BenchmarkTools.Trial: 10000 samples with 1 evaluation.
Range (min β¦ max): 415.816 ΞΌs β¦ 5.373 ms β GC (min β¦ max): 0.00% β¦ 90.70%
Time (median): 473.493 ΞΌs β GC (median): 0.00%
Time (mean Β± Ο): 481.312 ΞΌs Β± 105.862 ΞΌs β GC (mean Β± Ο): 0.54% Β± 2.66%
ββββ
β
ββββββ
βββ
βββββ
βββββββββ
βββββββββββββββββββββββββββ
β
β
β
ββββββββββββββββββββββ β
416 ΞΌs Histogram: frequency by time 575 ΞΌs <
Memory estimate: 129.17 KiB, allocs estimate: 5.
julia> N = 100; A = rand(N, N); M = Symmetric(A'A);
julia> @benchmark inv(M)
BenchmarkTools.Trial: 9563 samples with 1 evaluation.
Range (min β¦ max): 437.397 ΞΌs β¦ 5.713 ms β GC (min β¦ max): 0.00% β¦ 90.19%
Time (median): 509.356 ΞΌs β GC (median): 0.00%
Time (mean Β± Ο): 518.800 ΞΌs Β± 133.612 ΞΌs β GC (mean Β± Ο): 0.91% Β± 3.63%
βββββ
βββββββ
β
β
βββββ
ββββββββββββββ
βββββββββββββββββββββββββββ
β
βββββββββββββββββββ β
437 ΞΌs Histogram: frequency by time 600 ΞΌs <
Memory estimate: 129.20 KiB, allocs estimate: 6.
```

also I see O(N^2), so I guess itβs using the CoppersmithβWinograd algorithm and not something specialised like LDU:

```
julia> N = 10; A = rand(N, N); M = Symmetric(A'A);
julia> @btime inv(M);
1.442 ΞΌs (5 allocations: 6.17 KiB)
julia> N = 100; A = rand(N, N); M = Symmetric(A'A);
julia> @btime inv(M);
146.709 ΞΌs (6 allocations: 129.20 KiB)
julia> N = 1000; A = rand(N, N); M = Symmetric(A'A);
julia> @btime inv(M);
16.408 ms (6 allocations: 8.13 MiB)
```