Benchmarks
a = rand(Vec{3})
A = rand(SecondOrderTensor{3})
S = rand(SymmetricSecondOrderTensor{3})
B = rand(Tensor{Tuple{3,3,3}})
AA = rand(FourthOrderTensor{3})
SS = rand(SymmetricFourthOrderTensor{3})| Operation | Tensor | Array | speed-up |
|---|---|---|---|
| Single contraction | |||
a ⋅ a | 2.100 ns | 12.212 ns | ×5.8 |
A ⋅ a | 3.100 ns | 77.838 ns | ×25.1 |
S ⋅ a | 3.100 ns | 77.550 ns | ×25.0 |
| Double contraction | |||
A ⊡ A | 5.700 ns | 16.333 ns | ×2.9 |
S ⊡ S | 3.300 ns | 15.516 ns | ×4.7 |
B ⊡ A | 8.208 ns | 235.068 ns | ×28.6 |
AA ⊡ A | 9.209 ns | 261.733 ns | ×28.4 |
SS ⊡ S | 5.700 ns | 261.988 ns | ×46.0 |
| Tensor product | |||
a ⊗ a | 4.800 ns | 53.966 ns | ×11.2 |
| Cross product | |||
a × a | 4.800 ns | 53.966 ns | ×11.2 |
| Determinant | |||
det(A) | 2.800 ns | 277.866 ns | ×99.2 |
det(S) | 3.000 ns | 272.076 ns | ×90.7 |
| Inverse | |||
inv(A) | 24.198 ns | 738.632 ns | ×30.5 |
inv(S) | 14.529 ns | 664.179 ns | ×45.7 |
inv(AA) | 1.460 μs | 2.311 μs | ×1.6 |
inv(SS) | 657.525 ns | 2.311 μs | ×3.5 |
The benchmarks are generated by runbenchmarks.jl on the following system:
julia> versioninfo()
Julia Version 1.5.4
Commit 69fcb5745b (2021-03-11 19:13 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, haswell)