FAQ
I done a small bench on the crawler (http://github.com/bodokaiser/crawler <http://github.com/bodokaiser/crawler>) with different channel sizes.

For benchmarking I output all urls with there referenced links to stdout and measure the average rate with „pipe viewer“.

My results (always measured after 10s):
Channel size of 0: 13 KiB/s, 10 KiB/s, 8.5 KiB/s, 7.4 KiB/s
Channel size of 10: 10.9 KiB/s, 9.8 KiB/s, 8.3 KiB/s, 7 KiB/s
Channel size of 100: 9.16 KiB/s, 7.8 KiB/s, 6.7 KiB/s, 5.8 KiB/s

I interpret the results in that way that the throughput gets lower the higher the channel capacity is.

Though I must admit that the there are a lot of other points which could have influenced the test (e.g. order of sites which were crawled, socket available from the OS, …).
Am 11.09.2014 um 01:55 schrieb Caleb Spare <cespare@gmail.com>:

Two cases where buffer sizes > 1 seem fine to me:

- Using a channel as quick'n'easy FIFO queue of size N
- There is some necessary performance advantage that comes from using
a larger buffer size. (For instance, the consumer at the end of the
buffer might have spiky performance and buffering up extra items
improves throughput.) In this case, the magical size value ought to be
accompanied by some benchmark to justify it.

-Caleb
On Wed, Sep 10, 2014 at 1:54 PM, Dave Cheney wrote:
I believe there are only two values for a channel's buffer, 0 and 1. Setting
a value higher than 1 is really saying "well, I sort of want to buffer as
much as I can, I hope this number is enough", and that is not a stable way
to design systems.

On Thursday, 11 September 2014 03:24:48 UTC+10, i...@bodokaiser.io wrote:

If we have 100 go routines what would be a good size for a buffered
channel which all go routines receive data from (if filling the channel is
not considered the bottle neck)?
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 7 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedSep 10, '14 at 5:24p
activeSep 14, '14 at 12:37p
posts7
users5
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase