client-go/testing
Quan Tian faf5681d1c Improve fake clientset performance
The fake clientset used a slice to store each kind of objects, it's
quite slow to init the clientset with massive objects because it checked
existence of an object by traversing all objects before adding it, which
leads to O(n^2) time complexity. Also, the Create, Update, Get, Delete
methods needs to traverse all objects, which affects the time statistic
of code that calls them.

This patch changed to use a map to store each kind of objects, reduced
the time complexity of initializing clientset to O(n) and the Create,
Update, Get, Delete to O(1).

For example:
Before this patch, it took ~29s to init a clientset with 30000 Pods,
and 2~4ms to create and get an Pod.
After this patch, it took ~50ms to init a clientset with 30000 Pods,
and tens of µs to create and get an Pod.

Kubernetes-commit: 7e15e31e11e48a6db855e30ca9b07dbce3047577
2020-03-27 18:39:20 +08:00
..
actions.go Allow Action's Matches function to specify a subresource. 2020-01-30 12:04:23 +01:00
fake_test.go Use a single deep copied object between all reactors in fake client 2019-01-31 17:42:04 +00:00
fake.go Use a single deep copied object between all reactors in fake client 2019-01-31 17:42:04 +00:00
fixture_test.go Require exact match when calling Get method within fake clientset 2019-09-17 17:52:28 +02:00
fixture.go Improve fake clientset performance 2020-03-27 18:39:20 +08:00