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 ⋅ a3.095 ns9.567 ns×3.1
A ⋅ a3.095 ns62.546 ns×20.2
S ⋅ a3.406 ns62.526 ns×18.4
Double contraction
A ⊡ A3.706 ns11.111 ns×3.0
S ⊡ S3.095 ns11.422 ns×3.7
B ⊡ A5.410 ns129.010 ns×23.8
AA ⊡ A7.722 ns148.593 ns×19.2
SS ⊡ S4.328 ns148.480 ns×34.3
Tensor product
a ⊗ a3.406 ns39.004 ns×11.5
Cross product
a × a3.406 ns39.004 ns×11.5
Determinant
det(A)3.095 ns182.181 ns×58.9
det(S)3.406 ns188.802 ns×55.4
Inverse
inv(A)5.801 ns552.484 ns×95.2
inv(S)4.879 ns545.508 ns×111.8
inv(AA)904.744 ns1.548 μs×1.7
inv(SS)319.929 ns1.559 μs×4.9

The benchmarks are generated by runbenchmarks.jl on the following system:

julia> versioninfo()
Julia Version 1.10.1
Commit 7790d6f0641 (2024-02-13 20:41 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)