mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 06:27:05 +00:00
Merge pull request #83035 from robscott/endpointslice-proxy-sort-perf
Updating EndpointSliceCache sort function to be significantly faster.
This commit is contained in:
commit
7de6f0eb95
@ -249,5 +249,5 @@ func (e byIP) Swap(i, j int) {
|
|||||||
e[i], e[j] = e[j], e[i]
|
e[i], e[j] = e[j], e[i]
|
||||||
}
|
}
|
||||||
func (e byIP) Less(i, j int) bool {
|
func (e byIP) Less(i, j int) bool {
|
||||||
return e[i].IP() < e[j].IP()
|
return e[i].String() < e[j].String()
|
||||||
}
|
}
|
||||||
|
@ -99,8 +99,8 @@ func TestEndpointsMapFromESC(t *testing.T) {
|
|||||||
},
|
},
|
||||||
expectedMap: map[ServicePortName][]*BaseEndpointInfo{
|
expectedMap: map[ServicePortName][]*BaseEndpointInfo{
|
||||||
makeServicePortName("ns1", "svc1", "port-0"): {
|
makeServicePortName("ns1", "svc1", "port-0"): {
|
||||||
&BaseEndpointInfo{Endpoint: "10.0.1.1:80"},
|
|
||||||
&BaseEndpointInfo{Endpoint: "10.0.1.10:80"},
|
&BaseEndpointInfo{Endpoint: "10.0.1.10:80"},
|
||||||
|
&BaseEndpointInfo{Endpoint: "10.0.1.1:80"},
|
||||||
&BaseEndpointInfo{Endpoint: "10.0.1.2:80"},
|
&BaseEndpointInfo{Endpoint: "10.0.1.2:80"},
|
||||||
&BaseEndpointInfo{Endpoint: "10.0.1.3:80"},
|
&BaseEndpointInfo{Endpoint: "10.0.1.3:80"},
|
||||||
&BaseEndpointInfo{Endpoint: "10.0.1.4:80"},
|
&BaseEndpointInfo{Endpoint: "10.0.1.4:80"},
|
||||||
|
Loading…
Reference in New Issue
Block a user