1
0
Fork 0
forked from fun/fun

Holiday is over, now I have fun again. No code changes. (0.38.11)

This commit is contained in:
Johannes Findeisen 2026-02-18 17:39:10 +01:00
commit f896e1d3bf
13 changed files with 329 additions and 0 deletions

21
docs/performance.md Normal file
View file

@ -0,0 +1,21 @@
# Performance Guide
Tips for getting good performance from Fun programs and builds.
## Build configuration
- Use `-DCMAKE_BUILD_TYPE=Release` for production binaries.
- Consider `FUN_DEBUG=OFF` to remove extra checks in hot paths.
- `FUN_USE_MUSL=ON` can help with static/portable builds; measure performance for your use case.
## Language-level tips
- Prefer pre-sized arrays/maps when possible to reduce reallocations.
- Avoid unnecessary string concatenations in loops; accumulate in arrays and `join`.
- Push work to native ops where available (e.g., regex, JSON, math helpers).
## Algorithmic choices
- Choose appropriate data structures (arrays for ordered scans, maps for key lookups).
- Cache repeated computations or lookups when safe.
## Measuring
- Create small, representative benchmarks.
- Compare Debug vs. Release to ensure changes are meaningful.