Skip to content

Commit

Permalink
refactor: use github.com/go-chi/chi/v5@v5.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
aofei committed Apr 8, 2023
1 parent 3f4ce80 commit 22b0f9d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ A new router is only eligible to be added if it:

```bash
$ go version
go version go1.19 darwin/arm64
go version go1.20.3 darwin/arm64
$ go list -m all | tail -n +2
github.com/aofei/r2 v0.3.3
github.com/go-chi/chi/v5 v5.0.7
github.com/go-chi/chi/v5 v5.0.8
github.com/gorilla/mux v1.8.0
github.com/julienschmidt/httprouter v1.3.0
$ go test -bench .
goos: darwin
goarch: arm64
pkg: github.com/aofei/go-http-request-routing-benchmark
BenchmarkStatic_R2-8 243672 4935 ns/op 0 B/op 0 allocs/op
BenchmarkStatic_HttpRouter-8 198285 5800 ns/op 0 B/op 0 allocs/op
BenchmarkStatic_Chi-8 31813 37508 ns/op 47741 B/op 314 allocs/op
BenchmarkStatic_GorillaMux-8 3664 321306 ns/op 113171 B/op 1107 allocs/op
BenchmarkGitHubAPI_R2-8 56254 21299 ns/op 4417 B/op 184 allocs/op
BenchmarkGitHubAPI_HttpRouter-8 26709 45042 ns/op 75360 B/op 736 allocs/op
BenchmarkGitHubAPI_Chi-8 17653 67715 ns/op 67203 B/op 442 allocs/op
BenchmarkGitHubAPI_GorillaMux-8 562 2140637 ns/op 218190 B/op 1731 allocs/op
BenchmarkGPlusAPI_R2-8 1225162 982.7 ns/op 264 B/op 11 allocs/op
BenchmarkGPlusAPI_HttpRouter-8 503544 2358 ns/op 4248 B/op 44 allocs/op
BenchmarkGPlusAPI_Chi-8 383004 3129 ns/op 3953 B/op 26 allocs/op
BenchmarkGPlusAPI_GorillaMux-8 73671 16052 ns/op 12788 B/op 102 allocs/op
BenchmarkParseAPI_R2-8 961836 1283 ns/op 384 B/op 16 allocs/op
BenchmarkParseAPI_HttpRouter-8 355927 3332 ns/op 5888 B/op 64 allocs/op
BenchmarkParseAPI_Chi-8 201124 5915 ns/op 7906 B/op 52 allocs/op
BenchmarkParseAPI_GorillaMux-8 41199 29053 ns/op 23639 B/op 198 allocs/op
BenchmarkStatic_R2-8 236452 5084 ns/op 0 B/op 0 allocs/op
BenchmarkStatic_HttpRouter-8 185234 5618 ns/op 0 B/op 0 allocs/op
BenchmarkStatic_Chi-8 35596 33717 ns/op 47741 B/op 314 allocs/op
BenchmarkStatic_GorillaMux-8 3904 306781 ns/op 113171 B/op 1107 allocs/op
BenchmarkGitHubAPI_R2-8 54349 22111 ns/op 4417 B/op 184 allocs/op
BenchmarkGitHubAPI_HttpRouter-8 28010 43961 ns/op 75360 B/op 736 allocs/op
BenchmarkGitHubAPI_Chi-8 20300 58942 ns/op 67203 B/op 442 allocs/op
BenchmarkGitHubAPI_GorillaMux-8 562 2118916 ns/op 218188 B/op 1731 allocs/op
BenchmarkGPlusAPI_R2-8 1000000 1023 ns/op 264 B/op 11 allocs/op
BenchmarkGPlusAPI_HttpRouter-8 546333 2195 ns/op 4248 B/op 44 allocs/op
BenchmarkGPlusAPI_Chi-8 432822 2780 ns/op 3953 B/op 26 allocs/op
BenchmarkGPlusAPI_GorillaMux-8 74625 16112 ns/op 12788 B/op 102 allocs/op
BenchmarkParseAPI_R2-8 764920 1496 ns/op 384 B/op 16 allocs/op
BenchmarkParseAPI_HttpRouter-8 373254 3322 ns/op 5888 B/op 64 allocs/op
BenchmarkParseAPI_Chi-8 226174 5345 ns/op 7906 B/op 52 allocs/op
BenchmarkParseAPI_GorillaMux-8 41613 28922 ns/op 23639 B/op 198 allocs/op
PASS
ok github.com/aofei/go-http-request-routing-benchmark 23.927s
ok github.com/aofei/go-http-request-routing-benchmark 22.602s
```

## Community
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.13

require (
github.com/aofei/r2 v0.3.3
github.com/go-chi/chi/v5 v5.0.7
github.com/go-chi/chi/v5 v5.0.8
github.com/gorilla/mux v1.8.0
github.com/julienschmidt/httprouter v1.3.0
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
github.com/aofei/r2 v0.3.3 h1:73e+lPjGr57oK8+CxYZQXXqD17aqRR0kg27iY7I9hL0=
github.com/aofei/r2 v0.3.3/go.mod h1:iEHaCQDYveh0PaCqyfAr9CKdn2lR8kLpclrjtlSz/Iw=
github.com/go-chi/chi/v5 v5.0.7 h1:rDTPXLDHGATaeHvVlLcR4Qe0zftYethFucbjVQ1PxU8=
github.com/go-chi/chi/v5 v5.0.7/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/go-chi/chi/v5 v5.0.8 h1:lD+NLqFcAi1ovnVZpsnObHGW4xb4J8lNmoYVfECH1Y0=
github.com/go-chi/chi/v5 v5.0.8/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI=
github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So=
github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U=
Expand Down

0 comments on commit 22b0f9d

Please sign in to comment.