Skip to content

Conversation

@manugupt1
Copy link
Contributor

ReadUint is modified to take a byteBuffer and the file contents
are copied into it. The buf sync pool is created at the controller
level so that it controller determines if it needs one.

Ran a benchmark on pids test.

Earlier:

goos: linux
goarch: amd64
pkg: github.com/containerd/cgroups/v3/cgroup1
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
BenchmarkPids-8 59758 19905 ns/op 2064 B/op 15 allocs/op
PASS
ok github.com/containerd/cgroups/v3/cgroup1 1.405s

With this change:
goos: linux
goarch: amd64
pkg: github.com/containerd/cgroups/v3/cgroup1
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
BenchmarkPids-8 57368 21665 ns/op 1345 B/op 13 allocs/op
PASS
ok github.com/containerd/cgroups/v3/cgroup1 1.467s

Inspired from: #275

Signed-off-by: Manu Gupta [email protected]

ReadUint is modified to take a byteBuffer and the file contents
are copied into it. The buf sync pool is created at the controller
level so that it controller determines if it needs one.

Ran a benchmark on pids test.

Earlier:

goos: linux
goarch: amd64
pkg: github.com/containerd/cgroups/v3/cgroup1
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
BenchmarkPids-8   	   59758	     19905 ns/op	    2064 B/op	      15 allocs/op
PASS
ok  	github.com/containerd/cgroups/v3/cgroup1	1.405s

With this change:
goos: linux
goarch: amd64
pkg: github.com/containerd/cgroups/v3/cgroup1
cpu: 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
BenchmarkPids-8   	   57368	     21665 ns/op	    1345 B/op	      13 allocs/op
PASS
ok  	github.com/containerd/cgroups/v3/cgroup1	1.467s

Inspired from: containerd#275

Signed-off-by: Manu Gupta <[email protected]>
@manugupt1 manugupt1 marked this pull request as ready for review April 1, 2023 23:22
@manugupt1
Copy link
Contributor Author

This is slower; so closing this.

@manugupt1 manugupt1 closed this Apr 1, 2023
@manugupt1 manugupt1 deleted the sync-pool branch April 1, 2023 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant