comparison benchmark/benchmarks.jl @ 1199:f095c02081eb tooling/benchmarks

More benchmarks
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 02 Feb 2023 10:30:46 +0100
parents 5d4a15d6118f
children 58a7aa15ce68
comparison
equal deleted inserted replaced
1198:5d4a15d6118f 1199:f095c02081eb
47 SUITE["derivatives"]["first_derivative"]["3D"]["z"] = @benchmarkable $u3 .= $Dz*$v3 47 SUITE["derivatives"]["first_derivative"]["3D"]["z"] = @benchmarkable $u3 .= $Dz*$v3
48 48
49 49
50 SUITE["derivatives"]["second_derivative"] = BenchmarkGroup() 50 SUITE["derivatives"]["second_derivative"] = BenchmarkGroup()
51 51
52 D₁ = second_derivative(g1,stencil_set) 52 D₂ = second_derivative(g1,stencil_set)
53 SUITE["derivatives"]["second_derivative"]["1D"] = @benchmarkable $u1 .= $D₁*$v1 53 SUITE["derivatives"]["second_derivative"]["1D"] = @benchmarkable $u1 .= $D₂*$v1
54 54
55 Dx = second_derivative(g2,stencil_set,1) 55 Dx = second_derivative(g2,stencil_set,1)
56 Dy = second_derivative(g2,stencil_set,2) 56 Dy = second_derivative(g2,stencil_set,2)
57 SUITE["derivatives"]["second_derivative"]["2D"] = BenchmarkGroup() 57 SUITE["derivatives"]["second_derivative"]["2D"] = BenchmarkGroup()
58 SUITE["derivatives"]["second_derivative"]["2D"]["x"] = @benchmarkable $u2 .= $Dx*$v2 58 SUITE["derivatives"]["second_derivative"]["2D"]["x"] = @benchmarkable $u2 .= $Dx*$v2
65 SUITE["derivatives"]["second_derivative"]["3D"]["x"] = @benchmarkable $u3 .= $Dx*$v3 65 SUITE["derivatives"]["second_derivative"]["3D"]["x"] = @benchmarkable $u3 .= $Dx*$v3
66 SUITE["derivatives"]["second_derivative"]["3D"]["y"] = @benchmarkable $u3 .= $Dy*$v3 66 SUITE["derivatives"]["second_derivative"]["3D"]["y"] = @benchmarkable $u3 .= $Dy*$v3
67 SUITE["derivatives"]["second_derivative"]["3D"]["z"] = @benchmarkable $u3 .= $Dz*$v3 67 SUITE["derivatives"]["second_derivative"]["3D"]["z"] = @benchmarkable $u3 .= $Dz*$v3
68 68
69 69
70
71 SUITE["derivatives"]["addition"] = BenchmarkGroup()
72
73 D₁ = first_derivative(g1,stencil_set)
74 D₂ = second_derivative(g1,stencil_set)
75 SUITE["derivatives"]["addition"]["1D"] = BenchmarkGroup()
76 SUITE["derivatives"]["addition"]["1D"]["apply,add"] = @benchmarkable $u1 .= $D₁*$v1 + $D₂*$v1
77 SUITE["derivatives"]["addition"]["1D"]["add,apply"] = @benchmarkable $u1 .= ($D₁ + $D₂)*$v1
78
79 Dxx = second_derivative(g2,stencil_set,1)
80 Dyy = second_derivative(g2,stencil_set,2)
81 SUITE["derivatives"]["addition"]["2D"] = BenchmarkGroup()
82 SUITE["derivatives"]["addition"]["2D"]["apply,add"] = @benchmarkable $u2 .= $Dxx*$v2 + $Dyy*$v2
83 SUITE["derivatives"]["addition"]["2D"]["add,apply"] = @benchmarkable $u2 .= ($Dxx + $Dyy)*$v2
84
85 Dxx = second_derivative(g3,stencil_set,1)
86 Dyy = second_derivative(g3,stencil_set,2)
87 Dzz = second_derivative(g3,stencil_set,3)
88 SUITE["derivatives"]["addition"]["3D"] = BenchmarkGroup()
89 SUITE["derivatives"]["addition"]["3D"]["apply,add"] = @benchmarkable $u3 .= $Dxx*$v3 + $Dyy*$v3 + $Dzz*$v3
90 SUITE["derivatives"]["addition"]["3D"]["add,apply"] = @benchmarkable $u3 .= ($Dxx + $Dyy + $Dzz)*$v3
91
92
93 SUITE["derivatives"]["composition"] = BenchmarkGroup()
94
95 Dx = first_derivative(g1,stencil_set)
96 SUITE["derivatives"]["composition"]["1D"] = BenchmarkGroup()
97 SUITE["derivatives"]["composition"]["1D"]["apply,apply"] = @benchmarkable $u1 .= $Dx*($Dx*$v1)
98 SUITE["derivatives"]["composition"]["1D"]["compose,apply"] = @benchmarkable $u1 .= ($Dx∘$Dx)*$v1
99
100 Dx = first_derivative(g2,stencil_set,1)
101 Dy = first_derivative(g2,stencil_set,2)
102 SUITE["derivatives"]["composition"]["2D"] = BenchmarkGroup()
103 SUITE["derivatives"]["composition"]["2D"]["apply,apply"] = @benchmarkable $u2 .= $Dy*($Dx*$v2)
104 SUITE["derivatives"]["composition"]["2D"]["compose,apply"] = @benchmarkable $u2 .= ($Dy∘$Dx)*$v2
105
106 Dx = first_derivative(g3,stencil_set,1)
107 Dy = first_derivative(g3,stencil_set,2)
108 Dz = first_derivative(g3,stencil_set,3)
109 SUITE["derivatives"]["composition"]["3D"] = BenchmarkGroup()
110 SUITE["derivatives"]["composition"]["3D"]["xy"] = BenchmarkGroup()
111 SUITE["derivatives"]["composition"]["3D"]["xy"]["apply,apply"] = @benchmarkable $u3 .= $Dx*($Dy*$v3)
112 SUITE["derivatives"]["composition"]["3D"]["xy"]["compose,apply"] = @benchmarkable $u3 .= ($Dx∘$Dy)*$v3
113
114 SUITE["derivatives"]["composition"]["3D"]["yz"] = BenchmarkGroup()
115 SUITE["derivatives"]["composition"]["3D"]["yz"]["apply,apply"] = @benchmarkable $u3 .= $Dy*($Dz*$v3)
116 SUITE["derivatives"]["composition"]["3D"]["yz"]["compose,apply"] = @benchmarkable $u3 .= ($Dy∘$Dz)*$v3
117
118 SUITE["derivatives"]["composition"]["3D"]["xz"] = BenchmarkGroup()
119 SUITE["derivatives"]["composition"]["3D"]["xz"]["apply,apply"] = @benchmarkable $u3 .= $Dx*($Dz*$v3)
120 SUITE["derivatives"]["composition"]["3D"]["xz"]["compose,apply"] = @benchmarkable $u3 .= ($Dx∘$Dz)*$v3
121
122 SUITE["derivatives"]["composition"]["3D"]["xx"] = BenchmarkGroup()
123 SUITE["derivatives"]["composition"]["3D"]["xx"]["apply,apply"] = @benchmarkable $u3 .= $Dx*($Dx*$v3)
124 SUITE["derivatives"]["composition"]["3D"]["xx"]["compose,apply"] = @benchmarkable $u3 .= ($Dx∘$Dx)*$v3
125
126 SUITE["derivatives"]["composition"]["3D"]["yy"] = BenchmarkGroup()
127 SUITE["derivatives"]["composition"]["3D"]["yy"]["apply,apply"] = @benchmarkable $u3 .= $Dy*($Dy*$v3)
128 SUITE["derivatives"]["composition"]["3D"]["yy"]["compose,apply"] = @benchmarkable $u3 .= ($Dy∘$Dy)*$v3
129
130 SUITE["derivatives"]["composition"]["3D"]["zz"] = BenchmarkGroup()
131 SUITE["derivatives"]["composition"]["3D"]["zz"]["apply,apply"] = @benchmarkable $u3 .= $Dz*($Dz*$v3)
132 SUITE["derivatives"]["composition"]["3D"]["zz"]["compose,apply"] = @benchmarkable $u3 .= ($Dz∘$Dz)*$v3
133
134 #TODO: Reorg with dimension as first level? To reduce operator creation?
135
70 SUITE 136 SUITE