@@ -25,67 +25,21 @@ out of any uniform Julia "struct".
25
25
## Speed
26
26
27
27
The speed of small ` SVector ` s, ` SMatrix ` s and ` SArray ` s is often > 10 × faster
28
- than ` Base.Array ` . See this sample benchmark (or see the full results [ here] ( https://github.com/andyferris/StaticArrays.jl/blob/master/perf/bench8 .txt ) ):
28
+ than ` Base.Array ` . See this simplified benchmark (or see the full results [ here] ( https://github.com/andyferris/StaticArrays.jl/blob/master/perf/bench10 .txt ) ):
29
29
30
30
```
31
- =====================================
32
- Benchmarks for 3×3 matrices
33
- =====================================
34
-
35
- Matrix multiplication (8.2x speedup)
36
- ------------------------------------
37
- Array -> 2.024568 seconds (74.07 M allocations: 6.623 GB, 9.37% gc time)
38
- SArray -> 0.247364 seconds (5 allocations: 240 bytes)
39
- MArray -> 1.603798 seconds (37.04 M allocations: 2.759 GB, 13.61% gc time)
40
- SizedArray -> 2.223853 seconds (74.07 M allocations: 6.071 GB, 10.05% gc time)
41
-
42
- Matrix multiplication (mutating) (3.1x speedup)
43
- -----------------------------------------------
44
- Array -> 1.360940 seconds (6 allocations: 480 bytes)
45
- MArray -> 0.443528 seconds (7 allocations: 400 bytes)
46
- SizedArray -> 0.681896 seconds (7 allocations: 416 bytes)
47
-
48
- Matrix addition (45x speedup)
49
- -----------------------------
50
- Array -> 1.458899 seconds (44.44 M allocations: 3.974 GB, 7.96% gc time)
51
- SArray -> 0.032043 seconds (5 allocations: 240 bytes)
52
- MArray -> 0.682318 seconds (22.22 M allocations: 1.656 GB, 18.70% gc time)
53
- SizedArray -> 1.111785 seconds (44.44 M allocations: 3.643 GB, 12.02% gc time)
54
-
55
- Matrix addition (mutating) (5.1x speedup)
56
- -----------------------------------------
57
- Array -> 0.493796 seconds (5 allocations: 320 bytes)
58
- MArray -> 0.096303 seconds (5 allocations: 240 bytes)
59
- SizedArray -> 0.135803 seconds (6 allocations: 336 bytes)
60
-
61
- Matrix determinant (170x speedup)
62
- ---------------------------------
63
- Array -> 15.291557 seconds (222.22 M allocations: 12.694 GB, 16.97% gc time)
64
- SArray -> 0.094409 seconds (4 allocations: 160 bytes)
65
- MArray -> 0.089569 seconds (4 allocations: 160 bytes)
66
- SizedArray -> 0.114134 seconds (4 allocations: 160 bytes)
67
-
68
- Matrix inverse (125x speedup)
69
- -----------------------------
70
- Array -> 47.704314 seconds (407.41 M allocations: 82.232 GB, 23.67% gc time)
71
- SArray -> 0.379657 seconds (4 allocations: 160 bytes)
72
- MArray -> 1.294672 seconds (37.04 M allocations: 2.759 GB, 19.77% gc time)
73
- SizedArray -> 2.136363 seconds (74.07 M allocations: 6.071 GB, 8.61% gc time)
74
-
75
- Matrix symmetric eigenvalue (105x speedup)
76
- ------------------------------------------
77
- Array -> 418.304283 seconds (740.74 M allocations: 89.407 GB, 1.22% gc time)
78
- SArray -> 3.963118 seconds (5 allocations: 256 bytes)
79
- MArray -> 3.964029 seconds (6 allocations: 272 bytes)
80
- SizedArray -> 4.028497 seconds (6 allocations: 208 bytes)
81
-
82
- Matrix Cholesky (23.6x speedup)
83
- -------------------------------
84
- Array -> 8.139431 seconds (222.22 M allocations: 9.934 GB, 6.28% gc time)
85
- SArray -> 0.344283 seconds (5 allocations: 256 bytes)
86
- MArray -> 0.812532 seconds (37.04 M allocations: 2.759 GB, 6.19% gc time)
87
- SizedArray -> 2.225999 seconds (74.07 M allocations: 6.071 GB, 11.41% gc time)
88
-
31
+ ============================================
32
+ Benchmarks for 3×3 Float64 matrices
33
+ ============================================
34
+
35
+ Matrix multiplication -> 8.2x speedup
36
+ Matrix multiplication (mutating) -> 3.1x speedup
37
+ Matrix addition -> 45x speedup
38
+ Matrix addition (mutating) -> 5.1x speedup
39
+ Matrix determinant -> 170x speedup
40
+ Matrix inverse -> 125x speedup
41
+ Matrix symmetric eigenvalue -> 105x speedup
42
+ Matrix Cholesky decomposition -> 23.6x speedup
89
43
```
90
44
91
45
(Run with ` julia -O3 ` for even faster SIMD code with immutable static arrays!)
0 commit comments