diff options
author | Valentin Rothberg <rothberg@redhat.com> | 2021-09-28 17:01:22 +0200 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-09-29 16:39:29 -0400 |
commit | ba74d6e6ecc2cc8e1480a466e29a078a93e24afa (patch) | |
tree | c5051bfcdcdc6363d1b4dabfa71eb7132500bd64 /libpod/networking_slirp4netns.go | |
parent | a1199dbaf1e42de665a8fc40ba0dd17d21f05ab7 (diff) | |
download | podman-ba74d6e6ecc2cc8e1480a466e29a078a93e24afa.tar.gz podman-ba74d6e6ecc2cc8e1480a466e29a078a93e24afa.tar.bz2 podman-ba74d6e6ecc2cc8e1480a466e29a078a93e24afa.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>
<MH: Fixed cherry-pick conflicts>
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 a09027b72..07c3aae3c 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{} |