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})
OperationTensorArrayspeed-up
Single contraction
a ⋅ a2.785 ns9.577 ns×3.4
A ⋅ a3.095 ns62.944 ns×20.3
S ⋅ a3.095 ns62.974 ns×20.3
Double contraction
A ⊡ A3.406 ns12.095 ns×3.6
S ⊡ S3.406 ns11.112 ns×3.3
B ⊡ A5.419 ns134.883 ns×24.9
AA ⊡ A7.732 ns145.162 ns×18.8
SS ⊡ S4.087 ns150.219 ns×36.8
Tensor product
a ⊗ a3.406 ns39.265 ns×11.5
Cross product
a × a3.406 ns39.265 ns×11.5
Determinant
det(A)3.396 ns191.000 ns×56.2
det(S)3.406 ns191.278 ns×56.2
Inverse
inv(A)5.801 ns488.241 ns×84.2
inv(S)4.889 ns493.082 ns×100.9
inv(AA)906.158 ns1.540 μs×1.7
inv(SS)325.468 ns1.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)