[go-nuts] non-linear behaviour with many chan allocations

15 views
Skip to first unread message

roger peppe

unread,
Apr 27, 2010, 4:30:57 AM4/27/10
to golang-nuts
i came across an interesting performance issue recently
in a program that does many channel allocations.

as the number of iterations increase, the time per
iteration also increases (non-linearly).

i've attached some code that demonstrates the issue,
and a set of graphs charting iterations (x axis) against
the various entries in runtime.MemStats. the time graph
shows time per iteration in microseconds.

any idea what's going on here? it seems like it's
probably the garbage collecting of channels that might
be the cause, but why should the time-per-collected-channel
increase with the number of channels?

i'm running on a dual processor macbook,
9c15ff12bfe3+ tip

(for the record, i was able to work around the issue in my
code, but thought the issue was still worth pointing out)


--
Subscription settings: http://groups.google.com/group/golang-nuts/subscribe?hl=en
graphs.pdf
tstchan.go
Reply all
Reply to author
Forward
0 new messages