runtime: heavy time.Now usage cause taskgated to consume lots of cpu #15290
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Darwin
Performance
Milestone
Please answer these questions before submitting your issue. Thanks!
go version
)?go version devel +bd72497 Mon Apr 11 01:52:10 2016 +0000 darwin/amd64
go env
)?darwin/amd64
Run this program
This program should cause 100% cpu usage.
The program causes 100% cpu usage, but
taskgated
is also heavily used , around 20% on my system.https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/taskgated.8.html
Reports that taskgated is responsible for implemting the mach
task_for_pid
syscall (?), so it looks like we're calling this syscall many times, we should probably not do that and cache the task port once per process.The text was updated successfully, but these errors were encountered: