9885:41d5abd18c57
2.2GHz Intel Core i7
$ GOMAXPROCS=1 ./6.out
sync 10000000 188 ns/op
buffered 50000000 70.4 ns/op
$ GOMAXPROCS=2 ./6.out
sync 1000000 2785 ns/op
buffered 500000 5046 ns/op
I wish I knew enough dtrace to be able to give more information. I
only have "Instruments" to examine the running of the program, if
anyone is interested I can send those traces.
andrey
Hello everyone,
I measured the performance of a simple Go channel benchmarking program
on Windows versus Linux on the same system with as processor an Intel
Core 2 Duo (T9300 2.5GHz) and 4 GB of memory.
I've been looking at this for the past few days trying to explain it,
but I can't. basically, sync chan communication (un-buffered) is
faster than buffered in OSX Lion.
Setting GOMAXPROC > 1 add an overhead since the program will be
running on two cores and need to communicate between them.
Your code don't do almost anything on the loop so the only thing that
takes time is the core communication, when using GOMAXPROC = 1 the
overhead is smaller and the program looks faster.
And like Kyle said:
--
André Moraes
http://andredevchannel.blogspot.com/