Re: multithread/concurrency/parallel methods and performance

2018-02-19 Thread Dmitry Olshansky via Digitalmars-d-learn
On Monday, 19 February 2018 at 14:57:22 UTC, SrMordred wrote: On Monday, 19 February 2018 at 05:54:53 UTC, Dmitry Olshansky wrote: The operation is trivial and dataset is rather small. In such cases SIMD with eg array ops is the way to go: result[] = values[] * values2[]; Yes, absolutely

Re: multithread/concurrency/parallel methods and performance

2018-02-19 Thread SrMordred via Digitalmars-d-learn
On Monday, 19 February 2018 at 05:54:53 UTC, Dmitry Olshansky wrote: The operation is trivial and dataset is rather small. In such cases SIMD with eg array ops is the way to go: result[] = values[] * values2[]; Yes, absolutely right :) I make a simple example to understand why the threads

Re: multithread/concurrency/parallel methods and performance

2018-02-19 Thread SrMordred via Digitalmars-d-learn
On Monday, 19 February 2018 at 05:49:54 UTC, Nicholas Wilson wrote: As SIZE=1024*1024 (i.e. not much, possibly well within L2 cache for 32bit) it may be that dealing with the concurrency overhead adds a significant amount of overhead. That 'concurrency overhead' is what i´m not getting. Since

Re: multithread/concurrency/parallel methods and performance

2018-02-18 Thread Dmitry Olshansky via Digitalmars-d-learn
On Sunday, 18 February 2018 at 17:54:58 UTC, SrMordred wrote: I´m experimenting with threads and related recently. (i´m just started so may be some terrrible mistakes here) With this base work: foreach(i ; 0 .. SIZE) { results[i] = values1[i] * values2[i]; } and then with this 3 others

Re: multithread/concurrency/parallel methods and performance

2018-02-18 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 18 February 2018 at 17:54:58 UTC, SrMordred wrote: I´m experimenting with threads and related recently. (i´m just started so may be some terrrible mistakes here) With this base work: foreach(i ; 0 .. SIZE) { results[i] = values1[i] * values2[i]; } and then with this 3 others

Re: multithread/concurrency/parallel methods and performance

2018-02-18 Thread Jordan Wilson via Digitalmars-d-learn
On Sunday, 18 February 2018 at 17:54:58 UTC, SrMordred wrote: I´m experimenting with threads and related recently. (i´m just started so may be some terrrible mistakes here) With this base work: foreach(i ; 0 .. SIZE) { results[i] = values1[i] * values2[i]; } and then with this 3 others

multithread/concurrency/parallel methods and performance

2018-02-18 Thread SrMordred via Digitalmars-d-learn
I´m experimenting with threads and related recently. (i´m just started so may be some terrrible mistakes here) With this base work: foreach(i ; 0 .. SIZE) { results[i] = values1[i] * values2[i]; } and then with this 3 others methods: parallel, spawn and Threads. this was my results: