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 <vrothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2023-01-23 14:40:17 +01:00
parent 0428730bd4
commit 5925fe1a58

View File

@ -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)