mirror of
https://github.com/moby/moby.git
synced 2026-07-11 18:13:57 +00:00
Improve performance of function daemon.Containers() (used by docker ps) to mitigate a latency increase when running large number of containers using the containerd image store. We do this by refactoring daemon.Containers() to collect info for containers in parallel, rather than sequentially, using up to log2(N) worker threads. This improves the performance from O(N) to O(log2(N)), where N is the number of containers. To verify correctness, this commits adds unit and integration tests. Signed-off-by: Cesar Talledo <cesar.talledo@docker.com>