Added bone

This commit is contained in:
Eduard Urbach 2024-03-13 23:39:35 +01:00
parent f9cc8530fb
commit 5099ba0019
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0
4 changed files with 27 additions and 0 deletions

View File

@ -7,6 +7,8 @@ BenchmarkAkyoto/Hello-12 29872866 38.33 ns/op
BenchmarkAkyoto/GitHub-12 15900098 72.91 ns/op 0 B/op 0 allocs/op BenchmarkAkyoto/GitHub-12 15900098 72.91 ns/op 0 B/op 0 allocs/op
BenchmarkBeego/Hello-12 1000000 1089 ns/op 880 B/op 8 allocs/op BenchmarkBeego/Hello-12 1000000 1089 ns/op 880 B/op 8 allocs/op
BenchmarkBeego/GitHub-12 722995 1654 ns/op 929 B/op 9 allocs/op BenchmarkBeego/GitHub-12 722995 1654 ns/op 929 B/op 9 allocs/op
BenchmarkBone/Hello-12 42497811 26.97 ns/op 0 B/op 0 allocs/op
BenchmarkBone/GitHub-12 91179 12734 ns/op 4705 B/op 67 allocs/op
BenchmarkChi/Hello-12 4328472 275.4 ns/op 336 B/op 2 allocs/op BenchmarkChi/Hello-12 4328472 275.4 ns/op 336 B/op 2 allocs/op
BenchmarkChi/GitHub-12 3447220 331.1 ns/op 336 B/op 2 allocs/op BenchmarkChi/GitHub-12 3447220 331.1 ns/op 336 B/op 2 allocs/op
BenchmarkEcho/Hello-12 19503808 51.41 ns/op 0 B/op 0 allocs/op BenchmarkEcho/Hello-12 19503808 51.41 ns/op 0 B/op 0 allocs/op

22
web/bone_test.go Normal file
View File

@ -0,0 +1,22 @@
package main_test
import (
"net/http"
"testing"
"github.com/go-zoo/bone"
)
func BenchmarkBone(b *testing.B) {
bench(
b,
func() *bone.Mux {
return bone.New()
},
func(mux *bone.Mux, method string, path string) {
mux.Register(method, path, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write(payload)
}))
},
)
}

View File

@ -9,6 +9,7 @@ require (
github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f github.com/bmizerany/pat v0.0.0-20210406213842-e4b6760bdd6f
github.com/gin-gonic/gin v1.9.1 github.com/gin-gonic/gin v1.9.1
github.com/go-chi/chi/v5 v5.0.12 github.com/go-chi/chi/v5 v5.0.12
github.com/go-zoo/bone v1.3.0
github.com/labstack/echo/v4 v4.11.4 github.com/labstack/echo/v4 v4.11.4
github.com/matryer/way v0.0.0-20180416093233-9632d0c407b0 github.com/matryer/way v0.0.0-20180416093233-9632d0c407b0
) )

View File

@ -40,6 +40,8 @@ github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJn
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js=
github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
github.com/go-zoo/bone v1.3.0 h1:PY6sHq37FnQhj+4ZyqFIzJQHvrrGx0GEc3vTZZC/OsI=
github.com/go-zoo/bone v1.3.0/go.mod h1:HI3Lhb7G3UQcAwEhOJ2WyNcsFtQX1WYHa0Hl4OBbhW8=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=