Benchmarks

Here are some benchmark timings for tensors in 3 dimensions. For comparison the timings for the same operations using standard Julia Arrays are also presented.

In the table below, a denotes a vector, A, As denotes second order non-symmetric and symmetric tensors and AA, AAs denotes fourth order non-symmetric and symmetric tensors respectively.

OperationTensorArrayspeed-up
Single contraction
a ⋅ a1.241 ns9.795 ns×7.9
A ⋅ a2.161 ns58.769 ns×27.2
A ⋅ A3.117 ns44.395 ns×14.2
As ⋅ As5.125 ns44.498 ns×8.7
Double contraction
A ⊡ A1.927 ns12.189 ns×6.3
As ⊡ As1.927 ns12.187 ns×6.3
AA ⊡ A6.087 ns78.554 ns×12.9
AA ⊡ AA60.820 ns280.502 ns×4.6
AAs ⊡ AAs22.104 ns281.003 ns×12.7
As ⊡ AAs ⊡ As9.466 ns89.747 ns×9.5
Outer product
a ⊗ a2.167 ns32.447 ns×15.0
A ⊗ A9.801 ns86.568 ns×8.8
As ⊗ As4.311 ns87.830 ns×20.4
Other operations
det(A)1.924 ns177.134 ns×92.1
det(As)1.924 ns182.831 ns×95.0
inv(A)6.099 ns595.591 ns×97.7
inv(As)4.587 ns635.858 ns×138.6
norm(a)1.494 ns9.838 ns×6.6
norm(A)1.990 ns16.752 ns×8.4
norm(As)2.011 ns16.757 ns×8.3
norm(AA)9.283 ns28.125 ns×3.0
norm(AAs)5.422 ns28.134 ns×5.2
a × a1.921 ns32.736 ns×17.0

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

julia> versioninfo()

Julia Version 0.6.0-pre.beta.297
Commit 2a61131* (2017-04-24 23:57 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i5-7600K CPU @ 3.80GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT NO_AFFINITY HASWELL)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)