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.785 ns | 9.577 ns | ×3.4 |
A ⋅ a | 3.095 ns | 62.944 ns | ×20.3 |
S ⋅ a | 3.095 ns | 62.974 ns | ×20.3 |
Double contraction | |||
A ⊡ A | 3.406 ns | 12.095 ns | ×3.6 |
S ⊡ S | 3.406 ns | 11.112 ns | ×3.3 |
B ⊡ A | 5.419 ns | 134.883 ns | ×24.9 |
AA ⊡ A | 7.732 ns | 145.162 ns | ×18.8 |
SS ⊡ S | 4.087 ns | 150.219 ns | ×36.8 |
Tensor product | |||
a ⊗ a | 3.406 ns | 39.265 ns | ×11.5 |
Cross product | |||
a × a | 3.406 ns | 39.265 ns | ×11.5 |
Determinant | |||
det(A) | 3.396 ns | 191.000 ns | ×56.2 |
det(S) | 3.406 ns | 191.278 ns | ×56.2 |
Inverse | |||
inv(A) | 5.801 ns | 488.241 ns | ×84.2 |
inv(S) | 4.889 ns | 493.082 ns | ×100.9 |
inv(AA) | 906.158 ns | 1.540 μs | ×1.7 |
inv(SS) | 325.468 ns | 1.543 μs | ×4.7 |
The benchmarks are generated by runbenchmarks.jl
on the following system:
julia> versioninfo()
Julia Version 1.10.2
Commit bd47eca2c8a (2024-03-01 10:14 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 4 × AMD EPYC 7763 64-Core Processor
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)