Golang: why using goroutines to parallelize calls ends up being slower?
|Added at||2017-01-01 20:01|
I have two versions of merge sort implementation. The first is a "normal" version and the second uses
One would assume that being able to parallelize this work would make the concurrent implementation faster: if I need to work on slice A and slice B, then working on them concurrently should be faster than doing so synchronously.
Now I'm assuming something is wrong with either my implementation of my understanding, because my concurrent version ends up being 13-14x slower than the sync version.
Can anyone point me in the right direction as to what I'm missing?
"Normal" (synchronous implementation):
Both use the same
This is my benchmarking code:
It reveals that the concurrent version is a lot slower than the normal synchronous version: