From f3d619bacf1dee3083c92e4910b3925c7fd23dea Mon Sep 17 00:00:00 2001 From: wrapperup Date: Wed, 28 Jun 2023 02:28:04 -0400 Subject: Add section for performance tips --- book/src/SUMMARY.md | 1 + book/src/performance.md | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 book/src/performance.md 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. -- cgit