Skip to content

Commit 2b78fe2

Browse files
authored
Merge pull request #24 from bmf-san/feature/update-servemux
Add new ServeMux test case
2 parents 27cb259 + f764aee commit 2b78fe2

File tree

36 files changed

+455
-424
lines changed

36 files changed

+455
-424
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,4 @@ workflows:
4646
- test:
4747
matrix:
4848
parameters:
49-
version: ["1.20", "1.19"]
49+
version: ["1.22"]

README.md

+87-83
Large diffs are not rendered by default.

benchmark_test.go

+15
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,21 @@ func BenchmarkStaticRoutes10ServeMux(b *testing.B) {
5151
benchmark(b, staticRoutes10, router)
5252
}
5353

54+
func BenchmarkPathParamRoutes1BracketServeMux(b *testing.B) {
55+
router := loadServeMux(pathParamRoutes1Bracket)
56+
benchmark(b, pathParamRoutes1Bracket, router)
57+
}
58+
59+
func BenchmarkPathParamRoutes5BracketServeMux(b *testing.B) {
60+
router := loadServeMux(pathParamRoutes5Bracket)
61+
benchmark(b, pathParamRoutes5Bracket, router)
62+
}
63+
64+
func BenchmarkPathParamRoutes10BracketServeMux(b *testing.B) {
65+
router := loadServeMux(pathParamRoutes10Bracket)
66+
benchmark(b, pathParamRoutes10Bracket, router)
67+
}
68+
5469
// bmf-san/goblin
5570
// https://github.com/bmf-san/goblin
5671
func BenchmarkStaticRoutesRootGoblin(b *testing.B) {

go.mod

+26-24
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,58 @@
11
module github.com/go-router-benchmark
22

3-
go 1.19
3+
go 1.22
44

55
require (
66
github.com/beego/mux v0.0.0-20170807094426-6660b4b5accb
7-
github.com/bmf-san/goblin v0.0.0-20230612165304-8aa4a2b4eb0a
7+
github.com/bmf-san/goblin v0.0.0-20231001152959-ea7a860c6b0c
88
github.com/dimfeld/httptreemux/v5 v5.5.0
99
github.com/gin-gonic/gin v1.9.1
10-
github.com/go-chi/chi/v5 v5.0.8
10+
github.com/go-chi/chi/v5 v5.0.12
1111
github.com/go-ozzo/ozzo-routing/v2 v2.4.0
1212
github.com/gocraft/web v0.0.0-20190207150652-9707327fb69b
13-
github.com/gorilla/mux v1.8.0
13+
github.com/gorilla/mux v1.8.1
1414
github.com/julienschmidt/httprouter v1.3.0
1515
github.com/labstack/echo v3.3.10+incompatible
1616
github.com/lkeix/techbook13-sample v0.0.0-20221218104044-fc1348dfcf99
1717
github.com/naoina/denco v0.0.0-20180930074809-8475105a6b4c
1818
github.com/nissy/bon v1.3.0
19-
github.com/uptrace/bunrouter v1.0.20
19+
github.com/uptrace/bunrouter v1.0.21
2020
github.com/vardius/gorouter/v4 v4.5.1
2121
)
2222

2323
require (
24-
github.com/andybalholm/brotli v1.0.5 // indirect
25-
github.com/bytedance/sonic v1.9.1 // indirect
26-
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
24+
github.com/andybalholm/brotli v1.1.0 // indirect
25+
github.com/bytedance/sonic v1.11.5 // indirect
26+
github.com/bytedance/sonic/loader v0.1.1 // indirect
27+
github.com/cloudwego/base64x v0.1.3 // indirect
28+
github.com/cloudwego/iasm v0.2.0 // indirect
2729
github.com/dimfeld/httptreemux v5.0.1+incompatible // indirect
28-
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
30+
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
2931
github.com/gin-contrib/sse v0.1.0 // indirect
3032
github.com/go-playground/locales v0.14.1 // indirect
3133
github.com/go-playground/universal-translator v0.18.1 // indirect
32-
github.com/go-playground/validator/v10 v10.14.1 // indirect
34+
github.com/go-playground/validator/v10 v10.19.0 // indirect
3335
github.com/goccy/go-json v0.10.2 // indirect
3436
github.com/json-iterator/go v1.1.12 // indirect
35-
github.com/klauspost/compress v1.16.5 // indirect
36-
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
37-
github.com/labstack/gommon v0.4.0 // indirect
38-
github.com/leodido/go-urn v1.2.4 // indirect
37+
github.com/klauspost/compress v1.17.8 // indirect
38+
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
39+
github.com/labstack/gommon v0.4.2 // indirect
40+
github.com/leodido/go-urn v1.4.0 // indirect
3941
github.com/mattn/go-colorable v0.1.13 // indirect
40-
github.com/mattn/go-isatty v0.0.19 // indirect
42+
github.com/mattn/go-isatty v0.0.20 // indirect
4143
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4244
github.com/modern-go/reflect2 v1.0.2 // indirect
43-
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
45+
github.com/pelletier/go-toml/v2 v2.2.1 // indirect
4446
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
45-
github.com/ugorji/go/codec v1.2.11 // indirect
47+
github.com/ugorji/go/codec v1.2.12 // indirect
4648
github.com/valyala/bytebufferpool v1.0.0 // indirect
47-
github.com/valyala/fasthttp v1.47.0 // indirect
49+
github.com/valyala/fasthttp v1.52.0 // indirect
4850
github.com/valyala/fasttemplate v1.2.2 // indirect
49-
golang.org/x/arch v0.3.0 // indirect
50-
golang.org/x/crypto v0.9.0 // indirect
51-
golang.org/x/net v0.10.0 // indirect
52-
golang.org/x/sys v0.9.0 // indirect
53-
golang.org/x/text v0.10.0 // indirect
54-
google.golang.org/protobuf v1.30.0 // indirect
51+
golang.org/x/arch v0.7.0 // indirect
52+
golang.org/x/crypto v0.22.0 // indirect
53+
golang.org/x/net v0.24.0 // indirect
54+
golang.org/x/sys v0.19.0 // indirect
55+
golang.org/x/text v0.14.0 // indirect
56+
google.golang.org/protobuf v1.33.0 // indirect
5557
gopkg.in/yaml.v3 v3.0.1 // indirect
5658
)

0 commit comments

Comments
 (0)