iris/_benchmarks/_internal
Gerasimos (Makis) Maropoulos ce2eae9121 add a dependency-injection examples folder for the next release and some improvements
Former-commit-id: 040168afb7caf808618f7da5e68ae8eb01cb7170
2020-03-01 02:17:19 +02:00
..
v12.1.x add a dependency-injection examples folder for the next release and some improvements 2020-03-01 02:17:19 +02:00
vNext add a dependency-injection examples folder for the next release and some improvements 2020-03-01 02:17:19 +02:00
README.md add a dependency-injection examples folder for the next release and some improvements 2020-03-01 02:17:19 +02:00
request.json ❤️ awesome and unique features for end-developers are coming... 2020-02-29 14:18:15 +02:00

Benchmarks (internal)

Internal selected benchmarks between modified features across different versions.

  • These benchmarks SHOULD run locally with a break of ~2 minutes between stress tests at the same machine, power plan and Turbo Boost set to ON
  • The system's GOPATH environment variable SHOULD match the vNext/go.mod replace directive one
  • A stress test may ran from a name_test.go file to measure BUILD TIME
    • each version executes: go test -run=NONE --bench=. -count=5 --benchmem > name_test.txt
    • the result will be presented through benchstat tool
  • Or/and by firing bombardier HTTP requests when it (the test) listens to an address
  • Each benchmark SHOULD contain a brief explanation of what it does.

Dependency Injection

Measures handler factory time.

$ cd v12.1.x
$ go test -run=NONE --bench=. -count=5 --benchmem > di_test.txt
$ cd ../vNext
$ go test -run=NONE --bench=. -count=5 --benchmem > di_test.txt
Name Ops Ns/op B/op Allocs/op
vNext 184512 6607 1544 17
v12.1.x 95974 12653 976 26

It accepts a dynamic path parameter and a JSON request. It returns a JSON response. Fires 500000 requests with 125 concurrent connections.

# di.go
$ bombardier -c 125 -n 500000 --method="POST" --body-file=./request.json http://localhost:5000/42
Name Throughput Reqs/sec Latency Time To Complete
vNext 46.51MB/s 160480.74 777.33us 3s
v12.1.x 32.43MB/s 108839.19 1.14ms 4s