Files
runc/libcontainer/cgroups
Kir Kolyshkin d0c3bc44e7 libct/cg: GetAllPids: optimize for go 1.16+
filepath.WalkDir function, introduced in Go 1.16, doesn't do stat(2)
on every entry, and is therefore somewhat faster (see below).

Since we have to support Go 1.15, keep the old version for backward
compatibility.

Add a quick benchmark, which shows approximately 3x improvement:

        $ go1.15.15 test -bench AllPid -run xxx .
	BenchmarkGetAllPids-4   	      48	  23528839 ns/op

        $ go version
        go version go1.16.6 linux/amd64
        $ go test -bench AllPid -run xxx .
	BenchmarkGetAllPids-4   	     147	   7700170 ns/op

(Unrelated but worth noting -- go 1.17rc2 is pushing it even further)

        $ go1.17rc2 test -bench AllPid -run xxx .
	BenchmarkGetAllPids-4   	     164	   6820994 ns/op

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2021-08-05 16:22:18 -07:00
..
2021-07-27 01:41:47 -07:00
2021-07-27 01:41:47 -07:00
2021-07-27 01:41:47 -07:00
2021-04-29 15:30:12 -07:00
2021-06-22 16:09:47 -07:00
2021-01-19 18:02:11 +01:00
2021-06-22 16:09:47 -07:00