aboutsummaryrefslogtreecommitdiffstats
path: root/book/src
diff options
context:
space:
mode:
authorLibravatar wrapperup <wrapperup4@gmail.com>2023-06-28 02:28:04 -0400
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2023-06-28 09:37:43 +0200
commitf3d619bacf1dee3083c92e4910b3925c7fd23dea (patch)
tree8725968eea6403e2fc721f89093639031a00f63f /book/src
parentcc7b9796d8ba07a46a92a2bc68933a460c7d7266 (diff)
downloadaskama-f3d619bacf1dee3083c92e4910b3925c7fd23dea.tar.gz
askama-f3d619bacf1dee3083c92e4910b3925c7fd23dea.tar.bz2
askama-f3d619bacf1dee3083c92e4910b3925c7fd23dea.zip
Add section for performance tips
Diffstat (limited to 'book/src')
-rw-r--r--book/src/SUMMARY.md1
-rw-r--r--book/src/performance.md16
2 files changed, 17 insertions, 0 deletions
diff --git a/book/src/SUMMARY.md b/book/src/SUMMARY.md
index 6613796..486e510 100644
--- a/book/src/SUMMARY.md
+++ b/book/src/SUMMARY.md
@@ -8,3 +8,4 @@
- [Template syntax](./template_syntax.md)
- [Filters](./filters.md)
- [Integrations](./integrations.md)
+- [Performance](./performance.md)
diff --git a/book/src/performance.md b/book/src/performance.md
new file mode 100644
index 0000000..499eeb9
--- /dev/null
+++ b/book/src/performance.md
@@ -0,0 +1,16 @@
+# Performance
+
+## Slow Debug Recompilations
+
+If you experience slow compile times when iterating with lots of templates,
+you can compile Askama's derive macros with a higher optimization level.
+This can speed up recompilation times dramatically.
+
+Add the following to `Cargo.toml` or `.cargo/config.toml`:
+```rust
+[profile.dev.package.askama_derive]
+opt-level = 3
+```
+
+This may affect clean compile times in debug mode, but incremental compiles
+will be faster.