templbench

command module
v0.0.0-...-5357122 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2024 License: MIT Imports: 12 Imported by: 0

README

GoReportCard

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 to test the performance of a server serving github.com/a-h/templ templates.

To run the benchmark, simply execute this in the repository root:

go run . -veg rate=0 -veg duration=5s -veg max-workers=12

For help, run:

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:

# 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/<name>, then execute:

go run . -run ./cmd/<name>

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL