Commit 8aaea77
authored
Replace
* Replace `eval` by generated function
Benchmarked on Turing.jl/test/stdlib/RandomMeasures.jl
```
julia> @benchmark run_chain() # eval
BenchmarkTools.Trial: 1 sample with 1 evaluation.
Single result which took 15.231 s (1.52% GC) to evaluate,
with a memory estimate of 679.26 MiB, over 9452913 allocations.
julia> @benchmark run_chain() # splatnew
BenchmarkTools.Trial: 1 sample with 1 evaluation.
Single result which took 14.665 s (1.55% GC) to evaluate,
with a memory estimate of 655.23 MiB, over 8972863 allocations.
julia> @benchmark run_chain() # eval
BenchmarkTools.Trial: 1 sample with 1 evaluation.
Single result which took 16.465 s (1.41% GC) to evaluate,
with a memory estimate of 679.21 MiB, over 9452903 allocations.
julia> @benchmark run_chain() # splatnew
BenchmarkTools.Trial: 1 sample with 1 evaluation.
Single result which took 15.409 s (1.50% GC) to evaluate,
with a memory estimate of 655.34 MiB, over 8972879 allocations.
```
So about 3.5% runtime reduction.
* Remove type annotation from generated functioneval by generated function (#119)1 parent 8db6c3a commit 8aaea77
2 files changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
176 | 186 | | |
177 | 187 | | |
178 | 188 | | |
179 | 189 | | |
180 | | - | |
181 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
182 | 195 | | |
183 | 196 | | |
184 | 197 | | |
| |||
0 commit comments