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.063 ns×20.1
S ⋅ a3.095 ns62.086 ns×20.1
Double contraction
A ⊡ A3.406 ns11.111 ns×3.3
S ⊡ S3.406 ns11.121 ns×3.3
B ⊡ A5.430 ns132.229 ns×24.4
AA ⊡ A7.742 ns145.648 ns×18.8
SS ⊡ S4.197 ns145.752 ns×34.7
Tensor product
a ⊗ a3.406 ns39.812 ns×11.7
Cross product
a × a3.406 ns39.812 ns×11.7
Determinant
det(A)3.396 ns182.065 ns×53.6
det(S)3.406 ns183.010 ns×53.7
Inverse
inv(A)5.851 ns497.513 ns×85.0
inv(S)4.879 ns488.804 ns×100.2
inv(AA)912.927 ns1.555 μs×1.7
inv(SS)321.294 ns1.552 μs×4.8

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

julia> versioninfo()
Julia Version 1.10.3
Commit 0b4590a5507 (2024-04-30 10:59 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)