-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
by consalus:
(on darwin 386) I created a simple test program (attached) to compare the cost of enumerating integers with a channel and a generating goroutine to the old fashioned loop way. However, I noticed that the version that uses the channel (invoke with 8.out -max 1000000 -method 0) can be an order of magnitude slower with GOMAXPROCS > 1. It consistently takes 0.200s or so with GOMAXPROCS=1, but with GOMAXPROCS=2, it is often as much as 5s, but sometimes as low as 0.3s. This isn't a terrible thing, since I shouldn't be setting GOMAXPROCS > 1 on a uniprocessor machine, but I wouldn't expect the performance impact to be so variable or significant. What is the expected output? What do you see instead? I'd expect a lesser and more consistent performance hit. What is your $GOOS? $GOARCH? darwin 386 Which revision are you sync'ed to? (hg log -l 1) changeset: 3977:a522a4541e0e
Attachments:
- try.go (742 bytes)