Closed shirou closed 6 months ago
This PR introduce host.EnableBootTimeCache to enable caching about BootTime. This may fix some of issues about CPU usage and performance.
host.EnableBootTimeCache
BootTime
% go test -bench . -benchmem goos: linux goarch: amd64 pkg: github.com/shirou/gopsutil/v3/host cpu: AMD Ryzen 7 5800HS with Radeon Graphics BenchmarkBootTimeWithCache-4 470418906 2.446 ns/op 0 B/op 0 allocs/op BenchmarkBootTimeWithoutCache-4 55986 20535 ns/op 9920 B/op 24 allocs/op
This PR introduce
host.EnableBootTimeCache
to enable caching aboutBootTime
. This may fix some of issues about CPU usage and performance.