32 lines
781 B
Markdown
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
|
||
|
```
|