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.567 ns | ×3.4 |
A ⋅ a | 3.396 ns | 65.700 ns | ×19.3 |
S ⋅ a | 3.706 ns | 65.802 ns | ×17.8 |
Double contraction | |||
A ⊡ A | 3.406 ns | 11.111 ns | ×3.3 |
S ⊡ S | 3.396 ns | 11.112 ns | ×3.3 |
B ⊡ A | 5.430 ns | 130.664 ns | ×24.1 |
AA ⊡ A | 7.722 ns | 155.259 ns | ×20.1 |
SS ⊡ S | 4.197 ns | 146.812 ns | ×35.0 |
Tensor product | |||
a ⊗ a | 3.406 ns | 39.893 ns | ×11.7 |
Cross product | |||
a × a | 3.406 ns | 39.893 ns | ×11.7 |
Determinant | |||
det(A) | 3.396 ns | 190.460 ns | ×56.1 |
det(S) | 3.095 ns | 188.991 ns | ×61.1 |
Inverse | |||
inv(A) | 5.811 ns | 495.482 ns | ×85.3 |
inv(S) | 4.929 ns | 494.113 ns | ×100.2 |
inv(AA) | 928.091 ns | 1.549 μs | ×1.7 |
inv(SS) | 357.704 ns | 1.557 μs | ×4.4 |
The benchmarks are generated by runbenchmarks.jl
on the following system:
julia> versioninfo()
Julia Version 1.10.5
Commit 6f3fdf7b362 (2024-08-27 14:19 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)