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.567 ns×3.4
A ⋅ a3.396 ns65.700 ns×19.3
S ⋅ a3.706 ns65.802 ns×17.8
Double contraction
A ⊡ A3.406 ns11.111 ns×3.3
S ⊡ S3.396 ns11.112 ns×3.3
B ⊡ A5.430 ns130.664 ns×24.1
AA ⊡ A7.722 ns155.259 ns×20.1
SS ⊡ S4.197 ns146.812 ns×35.0
Tensor product
a ⊗ a3.406 ns39.893 ns×11.7
Cross product
a × a3.406 ns39.893 ns×11.7
Determinant
det(A)3.396 ns190.460 ns×56.1
det(S)3.095 ns188.991 ns×61.1
Inverse
inv(A)5.811 ns495.482 ns×85.3
inv(S)4.929 ns494.113 ns×100.2
inv(AA)928.091 ns1.549 μs×1.7
inv(SS)357.704 ns1.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)