https://github.com/romshark/templbench
Benchmarking github.com/a-h/templ using vegeta
https://github.com/romshark/templbench
Last synced: 8 months ago
JSON representation
Benchmarking github.com/a-h/templ using vegeta
- Host: GitHub
- URL: https://github.com/romshark/templbench
- Owner: romshark
- License: mit
- Created: 2024-09-23T18:19:14.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-23T18:46:40.000Z (about 1 year ago)
- Last Synced: 2025-01-04T22:45:14.453Z (9 months ago)
- Language: Go
- Size: 627 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github.com/a-h/templ benchmark
```
templbench % ./run-std.sh
2024/09/23 20:23:14 Building server
2024/09/23 20:23:14 Running server with env: []
2024/09/23 20:23:14 Server PID: 1719
2024/09/23 20:23:15 Server OK
2024/09/23 20:23:15 Running benchmark with args: [attack -rate=0 -duration=5s -max-workers=12]
2024/09/23 20:23:20 Generating report...
Requests [total, rate, throughput] 286849, 57369.90, 57367.99
Duration [total, attack, wait] 5.000157875s, 4.999991375s, 166.5µs
Latencies [mean, 50, 95, 99, max] 171.065µs, 147.672µs, 336.016µs, 622.256µs, 4.748667ms
Bytes In [total, mean] 116747543, 407.00
Bytes Out [total, mean] 0, 0.00
Success [ratio] 100.00%
Status Codes [code:count] 200:286849
Error Set:
```This is a synthetic benchmark using
[github.com/tsenart/vegeta](https://github.com/tsenart/vegeta)
to test the performance of a server serving
[github.com/a-h/templ](https://github.com/a-h/templ) templates.To run the benchmark, simply execute this in the repository root:
```sh
go run . -veg rate=0 -veg duration=5s -veg max-workers=12
```For help, run:
```sh
go run . --help
```If you want to run the server process by yourself
then you may execute the benchmark without building and running the server:```sh
# Assuming your server already runs at http://127.0.0.1:9091
# and the endpoint you want to benchmark is GET http://127.0.0.1:9091/helloworld.
go run . -veg duration=5s -run "" -scheme http -host 127.0.0.1:9091 -method GET -path "/helloworld"
```## Adding Server Implementations
Add your server implementation under `./cmd/`, then execute:
```sh
go run . -run ./cmd/
```