Skip to content

Commit d75b9b6

Browse files
committed
add performance tipcs to documentation
1 parent f5c1ad8 commit d75b9b6

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ makedocs(
6565
"Changing the Layout" => "layout.md",
6666
"Plot Model Process" => "plot_model.md"
6767
],
68+
"Performance Tips" => "performance_tips.md",
6869
"API" => "api.md",
6970
"Developer Guide" => "developer_guide.md"
7071
]

docs/src/performance_tips.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Performance Tips
2+
3+
## General Tips
4+
5+
In Julia, high performance can be achieved by following a small set of principles, such as avoiding global variables, avoding heterogenous containers, and placing performance critical code in a function. The same basic principles apply when using `SequentialSamplingModels.jl`. See the [Julia documentation](https://docs.julialang.org/en/v1/manual/performance-tips/) for more details.
6+
7+
## Turing
8+
9+
Turing provides three general recommendations for developing performant code:
10+
11+
1. Ensure types are inferable using principles defined in the [Julia documentation](https://docs.julialang.org/en/v1/manual/performance-tips/)
12+
2. Use Multivariate distributions in place of Univariate distributions when applicable.
13+
3. Use forward mode automatic differentiation when your model has a small number of parameters (i.e., 5-10), and use reverse mode automatic differentiation for larger models.
14+
15+
See the [Turing documentation](https://turinglang.org/docs/tutorials/docs-13-using-turing-performance-tips/) for more details. Note that the Turing ecosystem provides a benchmarking package, [TuringBenchmarking.jl](https://turinglang.org/TuringBenchmarking.jl/dev/) to aid in the selection of an automatic differentiation backend.

0 commit comments

Comments
 (0)