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 ns8.825 ns×2.9
A ⋅ a2.855 ns57.533 ns×20.2
S ⋅ a3.406 ns57.604 ns×16.9
Double contraction
A ⊡ A3.706 ns10.249 ns×2.8
S ⊡ S3.406 ns10.249 ns×3.0
B ⊡ A5.439 ns119.386 ns×22.0
AA ⊡ A7.732 ns134.577 ns×17.4
SS ⊡ S3.857 ns134.330 ns×34.8
Tensor product
a ⊗ a3.406 ns36.641 ns×10.8
Cross product
a × a3.406 ns36.641 ns×10.8
Determinant
det(A)3.095 ns168.128 ns×54.3
det(S)3.095 ns177.522 ns×57.4
Inverse
inv(A)5.350 ns459.736 ns×85.9
inv(S)4.508 ns465.612 ns×103.3
inv(AA)836.014 ns1.442 μs×1.7
inv(SS)299.078 ns1.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)