Thanks everyone for looking into this. I've raised an issue

https://github.com/golang/go/issues/27707 


On Monday, September 17, 2018 at 4:29:15 PM UTC+8, Dave Cheney wrote:
>
> I've confirmed this uses 14% on a random OS X machine. Please raise a bug, 
> https://golang.org/issue/new
>
> On Monday, 17 September 2018 14:29:44 UTC+10, Robert Engels wrote:
>>
>> For reference, similar code under Java consumes 2.5 % CPU.
>>
>> I tested the Go code under OSX, and it is roughly 10%, which seems to be 
>> very high. Might be because the “context switching” is performed/attributed 
>> to the process (since it is internal), where for other systems it is the 
>> system call only, and so most of the cost is attributed to system/kernel 
>> activity.
>>
>>
>>
>> On Sep 16, 2018, at 8:47 AM, Lei Ni <nil...@gmail.com> wrote:
>>
>> import (
>>   "time"
>> )
>>
>> func main() {
>>   ticker := time.NewTicker(time.Millisecond)
>>   defer ticker.Stop()
>>   for range ticker.C {
>>   }
>> }
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to