kubernetes/pkg/controller/replicaset
Quan Tian fc462857bb Add controllerUID index to improve ReplicaSetController performance
Instead of listing all ReplicaSets in the namespace and checking their
controller UID, this patch adds a controllerUID index to the ReplicaSet
store and use it to get ReplicaSets with same controller, which reduces
the cost from O(#ReplicaSets) to O(1).

Benchmark results:
```
name                                 old time/op    new time/op    delta
GetReplicaSetsWithSameController-48    18.2µs ± 9%     0.4µs ± 5%  -97.64%  (p=0.008 n=5+5)

name                                 old alloc/op   new alloc/op   delta
GetReplicaSetsWithSameController-48    4.18kB ± 0%    0.05kB ± 0%  -98.85%  (p=0.008 n=5+5)

name                                 old allocs/op  new allocs/op  delta
GetReplicaSetsWithSameController-48      15.0 ± 0%       2.0 ± 0%  -86.67%  (p=0.008 n=5+5)
```
2021-05-26 18:12:07 +08:00
..
config hack/update-bazel.sh 2021-02-28 15:17:29 -08:00
doc.go
init_test.go switch over k/k to use klog v2 2020-05-16 07:54:27 -04:00
OWNERS Updates OWNERS files and OWNERS_ALIASES for SIG Apps to make reviewers 2019-04-16 11:35:21 -07:00
replica_set_test.go Add controllerUID index to improve ReplicaSetController performance 2021-05-26 18:12:07 +08:00
replica_set_utils_test.go ReplicaSet: Use apps/v1 for RS controller. 2018-03-19 13:18:23 -07:00
replica_set_utils.go switch over k/k to use klog v2 2020-05-16 07:54:27 -04:00
replica_set.go Add controllerUID index to improve ReplicaSetController performance 2021-05-26 18:12:07 +08:00