Skip to content

Tags: minio/mux

Tags

v1.9.2

Toggle v1.9.2's commit message
make it minimum go1.23, update github actions

v1.9.1

Toggle v1.9.1's commit message
added test for router in context

v1.9.0

Toggle v1.9.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
add github-actions (#1)

v1.8.2

Toggle v1.8.2's commit message
fix(go.mod): minimum go move to go1.18

v1.8.1

Toggle v1.8.1's commit message

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
perf: optionally omit the Route from the request context

Optionally save 3 allocations worth 448B per request with no vars.

```
$ go test -benchmem -benchtime 5000000x -bench BenchmarkMuxSimple
goos: linux
goarch: amd64
pkg: github.com/gorilla/mux
cpu: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
BenchmarkMuxSimple/default-8                             5000000               349.3 ns/op           496 B/op          4 allocs/op
BenchmarkMuxSimple/omit_route_from_ctx-8                 5000000               157.8 ns/op            48 B/op          1 allocs/op
PASS
ok      github.com/gorilla/mux  2.556s

$ go test -benchmem -benchtime 5000000x -bench BenchmarkMuxSimple
goos: linux
goarch: amd64
pkg: github.com/gorilla/mux
cpu: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
BenchmarkMuxSimple/default-8                             5000000               354.7 ns/op           496 B/op          4 allocs/op
BenchmarkMuxSimple/omit_route_from_ctx-8                 5000000               160.8 ns/op            48 B/op          1 allocs/op
PASS
ok      github.com/gorilla/mux  2.602s

$ go test -benchmem -benchtime 5000000x -bench BenchmarkMuxSimple
goos: linux
goarch: amd64
pkg: github.com/gorilla/mux
cpu: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
BenchmarkMuxSimple/default-8                             5000000               376.4 ns/op           496 B/op          4 allocs/op
BenchmarkMuxSimple/omit_route_from_ctx-8                 5000000               168.1 ns/op            48 B/op          1 allocs/op
PASS
ok      github.com/gorilla/mux  2.745s
```

```
$ go test -benchmem -benchtime 5000000x -bench BenchmarkPopulateContext
goos: linux
goarch: amd64
pkg: github.com/gorilla/mux
cpu: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
BenchmarkPopulateContext/no_populated_vars-8             5000000               381.6 ns/op           496 B/op          4 allocs/op
BenchmarkPopulateContext/empty_var-8                     5000000               913.6 ns/op           928 B/op          9 allocs/op
BenchmarkPopulateContext/populated_vars-8                5000000               914.0 ns/op           912 B/op          8 allocs/op
BenchmarkPopulateContext/omit_route_/static-8            5000000               168.6 ns/op            48 B/op          1 allocs/op
BenchmarkPopulateContext/omit_route_/dynamic-8           5000000               827.4 ns/op           880 B/op          8 allocs/op
PASS
ok      github.com/gorilla/mux  16.049s
```

Signed-off-by: Jakob Ackermann <[email protected]>

v1.8.0

Toggle v1.8.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
fix: regression in vars extract for wildcard host (gorilla#579)

Continuing from PR gorilla#447 we have to add extra
check to ignore the port as well

add tests to cover this case

v1.7.4

Toggle v1.7.4's commit message
perf: reduce allocations in (*routeRegexp).getURLQuery (gorilla#544)

A production server is seeing a significant amount of allocations in (*routeRegexp).getURLQuery

Since it is only interested in a single value and only the first value we create a specialized function for that.

Comparing a few parameter parsing scenarios:

```
Benchmark_findQueryKey/0-8 	 7184014	       168 ns/op	       0 B/op	       0 allocs/op
Benchmark_findQueryKey/1-8 	 5307873	       227 ns/op	      48 B/op	       3 allocs/op
Benchmark_findQueryKey/2-8 	 1560836	       770 ns/op	     483 B/op	      10 allocs/op
Benchmark_findQueryKey/3-8 	 1296200	       931 ns/op	     559 B/op	      11 allocs/op
Benchmark_findQueryKey/4-8 	  666502	      1769 ns/op	       3 B/op	       1 allocs/op

Benchmark_findQueryKeyGoLib/0-8 	 1740973	       690 ns/op	     864 B/op	       8 allocs/op
Benchmark_findQueryKeyGoLib/1-8 	 3029618	       393 ns/op	     432 B/op	       4 allocs/op
Benchmark_findQueryKeyGoLib/2-8 	  461427	      2511 ns/op	    1542 B/op	      24 allocs/op
Benchmark_findQueryKeyGoLib/3-8 	  324252	      3804 ns/op	    1984 B/op	      28 allocs/op
Benchmark_findQueryKeyGoLib/4-8 	   69348	     14928 ns/op	   12716 B/op	     130 allocs/op
```

v1.7.3

Toggle v1.7.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Update stale.yml (gorilla#494)

v1.7.2

Toggle v1.7.2's commit message
host:port matching does not require a :port to be specified.

In lieu of checking the template pattern on every Match request, a bool is added to the routeRegexp, and set
if the routeRegexp is a host AND there is no ":" in the template. I dislike extending the type, but I'd dislike
doing a string match on every single Match, even more.

v1.7.1

Toggle v1.7.1's commit message
[build] Remove sudo setting from travis.yml (gorilla#462)