From d08b4c1339c123555c2da0cb1863f36196d042b7 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 12 Oct 2022 10:33:24 +0200 Subject: [PATCH] ContainerEngine.SetupRootless(): Avoid calling container.Config() This is a very expensive call as it deep duplicates the Config, and we just need to read a single member, so use ConfigNoCopy() instead. [NO NEW TESTS NEEDED] Just minor performance effects Signed-off-by: Alexander Larsson --- pkg/domain/infra/abi/system.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/domain/infra/abi/system.go b/pkg/domain/infra/abi/system.go index da903df9e9..6dd3165e11 100644 --- a/pkg/domain/infra/abi/system.go +++ b/pkg/domain/infra/abi/system.go @@ -136,7 +136,7 @@ func (ic *ContainerEngine) SetupRootless(_ context.Context, noMoveProcess bool) paths := []string{} for _, ctr := range ctrs { - paths = append(paths, ctr.Config().ConmonPidFile) + paths = append(paths, ctr.ConfigNoCopy().ConmonPidFile) } if len(paths) > 0 {