containerd/pkg/seccomp
Kir Kolyshkin 3292ea5862 pkg/seccomp: use sync.Once to speed up IsEnabled
It does not make sense to check if seccomp is supported by the kernel
more than once per runtime, so let's use sync.Once to speed it up.

A quick benchmark (old implementation, before this commit, after):

BenchmarkIsEnabledOld-4           37183            27971 ns/op
BenchmarkIsEnabled-4            1252161              947 ns/op
BenchmarkIsEnabledOnce-4      666274008             2.14 ns/op

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-04-16 15:52:35 -07:00
..
seccomp_linux.go pkg/seccomp: use sync.Once to speed up IsEnabled 2021-04-16 15:52:35 -07:00
seccomp_unsupported.go Fix unsupported files exporting functions for apparmor and seccomp 2021-03-12 08:47:05 -08:00
seccomp.go pkg/seccomp: simplify IsEnabled, update doc 2021-04-16 15:52:35 -07:00