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 | 3.095 ns | 8.825 ns | ×2.9 |
A ⋅ a | 2.855 ns | 57.533 ns | ×20.2 |
S ⋅ a | 3.406 ns | 57.604 ns | ×16.9 |
Double contraction | |||
A ⊡ A | 3.706 ns | 10.249 ns | ×2.8 |
S ⊡ S | 3.406 ns | 10.249 ns | ×3.0 |
B ⊡ A | 5.439 ns | 119.386 ns | ×22.0 |
AA ⊡ A | 7.732 ns | 134.577 ns | ×17.4 |
SS ⊡ S | 3.857 ns | 134.330 ns | ×34.8 |
Tensor product | |||
a ⊗ a | 3.406 ns | 36.641 ns | ×10.8 |
Cross product | |||
a × a | 3.406 ns | 36.641 ns | ×10.8 |
Determinant | |||
det(A) | 3.095 ns | 168.128 ns | ×54.3 |
det(S) | 3.095 ns | 177.522 ns | ×57.4 |
Inverse | |||
inv(A) | 5.350 ns | 459.736 ns | ×85.9 |
inv(S) | 4.508 ns | 465.612 ns | ×103.3 |
inv(AA) | 836.014 ns | 1.442 μs | ×1.7 |
inv(SS) | 299.078 ns | 1.438 μs | ×4.8 |
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)