bouncer/doc/fr/tutorials/profiling.md
William Petit 3a9fde9bc9
Some checks are pending
Cadoles/bouncer/pipeline/head This commit looks good
Cadoles/bouncer/pipeline/pr-develop Build started...
feat: improve perf by caching proxy and layers locally
2024-05-28 16:45:15 +02:00

32 lines
781 B
Markdown

# Analyser les performances de Bouncer
1. Lancer un benchmark du proxy
```shell
go test -bench=. -run '^$' -count=5 -cpuprofile bench_proxy.prof ./internal/proxy
```
2. Visualiser les temps d'exécution
```shell
go tool pprof -web bench_proxy.prof
```
3. Comparer les performances d'une exécution à l'autre
```shell
# Lancer un premier benchmark
go test -bench=. -run '^$' -count=10 ./internal/proxy > bench_before.txt
# Faire des modifications sur les sources
# Lancer un second benchmark
go test -bench=. -run '^$' -count=10 ./internal/proxy > bench_after.txt
# Installer l'outil benchstat
make tools/benchstat/bin/benchstat
# Comparer les rapports
tools/benchstat/bin/benchstat bench_before.txt bench_after.txt
```