diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2021-09-28 17:01:22 +0200 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2021-09-28 17:18:02 +0200 |
commit | 5d6ea90e756cd48c90d9549d25c0150c9bb5c50c (patch) | |
tree | ffe239b2f0456df0489bf99dfc9d6399bb8b3561 /libpod/networking_slirp4netns.go | |
parent | 381ab48c2586a96932701a1fe270ebd2c32a04d4 (diff) | |
download | podman-5d6ea90e756cd48c90d9549d25c0150c9bb5c50c.tar.gz podman-5d6ea90e756cd48c90d9549d25c0150c9bb5c50c.tar.bz2 podman-5d6ea90e756cd48c90d9549d25c0150c9bb5c50c.zip |
libpod: do not call (*container).Config()
Access the container's config field directly inside of libpod instead of
calling `Config()` which in turn creates expensive JSON deep copies.
Accessing the field directly drops memory consumption of a simple
`podman run --rm busybox true` from 1245kB to 410kB.
[NO TESTS NEEDED]
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'libpod/networking_slirp4netns.go')
-rw-r--r-- | libpod/networking_slirp4netns.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/networking_slirp4netns.go b/libpod/networking_slirp4netns.go index cca55cb9b..46cda89a9 100644 --- a/libpod/networking_slirp4netns.go +++ b/libpod/networking_slirp4netns.go @@ -222,7 +222,7 @@ func (r *Runtime) setupSlirp4netns(ctr *Container) error { defer errorhandling.CloseQuiet(syncR) defer errorhandling.CloseQuiet(syncW) - havePortMapping := len(ctr.Config().PortMappings) > 0 + havePortMapping := len(ctr.config.PortMappings) > 0 logPath := filepath.Join(ctr.runtime.config.Engine.TmpDir, fmt.Sprintf("slirp4netns-%s.log", ctr.config.ID)) ctrNetworkSlipOpts := []string{} |