From 5925fe1a58dae1a5728b12ff17bcb0ac7ee133b8 Mon Sep 17 00:00:00 2001 From: Valentin Rothberg Date: Mon, 23 Jan 2023 14:40:17 +0100 Subject: [PATCH] ps: do not create copy of container config The user is only reading the config, so creating a copy turns out to be extremely expensive. With this change, listing containers is 1.39 times faster than before. [NO NEW TESTS NEEDED] as it is not a functional change. Signed-off-by: Valentin Rothberg --- pkg/ps/ps.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/ps/ps.go b/pkg/ps/ps.go index 37da0b1104..289c0bdf48 100644 --- a/pkg/ps/ps.go +++ b/pkg/ps/ps.go @@ -143,7 +143,7 @@ func ListContainerBatch(rt *libpod.Runtime, ctr *libpod.Container, opts entities } } - conConfig = c.Config() + conConfig = c.ConfigNoCopy() conState, err = c.State() if err != nil { return fmt.Errorf("unable to obtain container state: %w", err)