You're damn right here. First of all, I must admit that I've misinterpreted the
benchmark results (guilty). Yet, anyway, I think I know what's really happening
here. To make things really clear I ran the benchmark for all number of workers
from 1 to 9. Here is a cleaned up output:
Timing 1
OK... going back to the hypothesis in the OP
> The plateau is seemingly defined by the number of cores or, more correctly,
> by the number of supported threads.
This suggests that the benchmark is CPU-bound, which is supported by
your more recent observation "100% load for a single one"
Also, y
Is it possible that OS caching is having an effect on the performance?
It's sometimes necessary to run the same code several times before it
settles down to consistent results.
On 12/7/18, Vadim Belman wrote:
> There is not need for filling in the channel prior to starting workers.
> First of all
There is not need for filling in the channel prior to starting workers. First
of all, 100 repetitions of SHA256 per worker makes takes ~0.7sec on my system.
I didn't do benchmarking of the generator thread, but considering that even
your timing gives 0.054sec/per string – I will most definitely
That was a bit vague- meant that I suspect the workers are being
starved, since you have many consumers, and only a single thread
generating the 1k strings. I would prime the channel to be full - or
other restructuring the ensure all threads are kept busy.
-y
On Thu, Dec 6, 2018 at 10:56 PM yary
Not sure if your test is measuring what you expect- the setup of
generating 50 x 1k strings is taking 2.7sec on my laptop, and that's
reducing the apparent effect of parllelism.
$ perl6
To exit type 'exit' or '^D'
> my $c = Channel.new;
Channel.new
> { for 1..50 {$c.send((1..1024).map( { (' '..'Z'
Hi everybody!
I have recently played a bit with somewhat intense computations and tried to
parallelize them among a couple of threaded workers. The results were
somewhat... eh... discouraging. To sum up my findings I wrote a simple demo
benchmark:
use Digest::SHA;
use Bench;
su