Mercurial > repos > public > sbplib_julia
changeset 1304:37d615522c2f tooling/benchmarks
Add a simple benchmark demonstrating allocations with compositions
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 26 Apr 2023 13:08:05 +0200 |
parents | 2d34290fdc58 |
children | 7894d29ea8fa |
files | benchmark/benchmarks.jl |
diffstat | 1 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/benchmark/benchmarks.jl Thu Mar 23 08:55:31 2023 +0100 +++ b/benchmark/benchmarks.jl Wed Apr 26 13:08:05 2023 +0200 @@ -162,4 +162,18 @@ #TODO: Reorg with dimension as first level? To reduce operator creation? + + +SUITE["lazy_tensors"] = BenchmarkGroup() + +SUITE["lazy_tensors"]["compositions"] = BenchmarkGroup() +s = ScalingTensor(1.,(10,)) +u = rand(10) +v = similar(u) +s3 = s∘s∘s +s4 = s∘s∘s∘s +SUITE["lazy_tensors"]["compositions"]["s∘s∘s"] = @benchmarkable $v .= $s3*$u +SUITE["lazy_tensors"]["compositions"]["s∘s∘s∘s"] = @benchmarkable $v .= $s4*$u + + SUITE