Jump to page: 1 2
Thread overview
Short article on std.parallism
May 30, 2011
Jeremy Wright
May 30, 2011
Andrej Mitrovic
May 30, 2011
Johann MacDonagh
May 30, 2011
Graham Fawcett
May 30, 2011
Jeremy Wright
May 30, 2011
Jeremy Wright
May 30, 2011
Vladimir Panteleev
May 31, 2011
Andrej Mitrovic
May 31, 2011
Jonathan M Davis
May 31, 2011
Andrej Mitrovic
Jun 09, 2011
Robert Jacques
May 31, 2011
Jonathan M Davis
May 30, 2011
I implemented bucket sort in D to demonstrate how easy it is to use std.parallelism.  I welcome any feedback.

http://www.codestrokes.com/archives/116

Jeremy Wright 

May 30, 2011
Very cool article. :)

Btw, you can omit 'auto' when you use 'immutable' declarations.
May 30, 2011
On Sun, 29 May 2011 18:18:14 -0700, Jeremy Wright wrote:

> I implemented bucket sort in D to demonstrate how easy it is to use std.parallelism.  I welcome any feedback.
> 
> http://www.codestrokes.com/archives/116

Nice article. :)

A tip to make the code even more terse:  You can replace taskPool.parallel
() with parallel().  The latter just forwards to the former.  (See the
last item of the std.parallelism docs.)

-Lars
May 30, 2011
On 5/29/2011 9:18 PM, Jeremy Wright wrote:
> I implemented bucket sort in D to demonstrate how easy it is to use
> std.parallelism. I welcome any feedback.
>
> http://www.codestrokes.com/archives/116
>
> Jeremy Wright

Nice. Just a few nit-picks:

1. End of first paragraph: "makes writing parallel code, correct." -> "makes writing parallel code correct."

2. Middle of second paragraph: "The tools are designed to find deadlocks, analyze timing". You wrote that line in the paragraph above. Seemed a little clunky for me.

3. The light green used in the chart and the D code is difficult to see on the white background.

4. Maybe a little comment just before the version(MultiThreaded) line to show readers that this is where the magic happens. Helps for readers new to D so they're not stumbling over the initial bucket creation code.

5. Maybe a comment at the end talking about std.parallel_algorithm. I suppose this wouldn't be a good idea if the idea gets dropped or radically changed, but even a little comment mentioning how std.parallelism will be wrapped for easy algorithm usage in the future would be a good selling point.

Anyway, great article!
May 30, 2011
On Sun, 29 May 2011 18:18:14 -0700, Jeremy Wright wrote:

> I implemented bucket sort in D to demonstrate how easy it is to use std.parallelism.  I welcome any feedback.
> 
> http://www.codestrokes.com/archives/116


Haven't read it yet, but:

"like many faucets" --> "like many facets"

Best,
Graham
May 30, 2011
Wow! Thank you for your feedback. I'll work through your comments. I appreciate you all taking the time to read my article.

Jeremy Wright

"Jeremy Wright"  wrote in message news:irurgr$1g65$1@digitalmars.com...

I implemented bucket sort in D to demonstrate how easy it is to use
std.parallelism.  I welcome any feedback.

http://www.codestrokes.com/archives/116

Jeremy Wright 

May 30, 2011
Wow! Thank you for your feedback. I'll work through your comments. I appreciate you all taking the time to read my article.

Jeremy Wright

"Jeremy Wright"  wrote in message news:irurgr$1g65$1@digitalmars.com...

I implemented bucket sort in D to demonstrate how easy it is to use
std.parallelism.  I welcome any feedback.

http://www.codestrokes.com/archives/116

Jeremy Wright 

May 30, 2011
On Mon, 30 May 2011 04:18:14 +0300, Jeremy Wright <jeremy@codestrokes.com> wrote:

> I implemented bucket sort in D to demonstrate how easy it is to use std.parallelism.  I welcome any feedback.

One thing: I would suggest to avoid using ~= in a tight loop, as it is rather slow. Using std.array.appender for the first loop and std.array.join for the second one should be much faster.

-- 
Best regards,
 Vladimir                            mailto:vladimir@thecybershadow.net
May 31, 2011
On 5/30/11, Vladimir Panteleev <vladimir@thecybershadow.net> wrote:
> On Mon, 30 May 2011 04:18:14 +0300, Jeremy Wright <jeremy@codestrokes.com> wrote:
>
>> I implemented bucket sort in D to demonstrate how easy it is to use std.parallelism.  I welcome any feedback.
>
> One thing: I would suggest to avoid using ~= in a tight loop, as it is rather slow. Using std.array.appender for the first loop and std.array.join for the second one should be much faster.
>
> --
> Best regards,
>   Vladimir                            mailto:vladimir@thecybershadow.net
>

I wonder why we even have this operator in the language if we're supposed to avoid it all the time.
May 31, 2011
On 2011-05-30 22:52, Andrej Mitrovic wrote:
> On 5/30/11, Vladimir Panteleev <vladimir@thecybershadow.net> wrote:
> > On Mon, 30 May 2011 04:18:14 +0300, Jeremy Wright <jeremy@codestrokes.com>
> > 
> > wrote:
> >> I implemented bucket sort in D to demonstrate how easy it is to use std.parallelism.  I welcome any feedback.
> > 
> > One thing: I would suggest to avoid using ~= in a tight loop, as it is rather slow. Using std.array.appender for the first loop and std.array.join for the second one should be much faster.
> > 
> > --
> > Best regards,
> > 
> >   Vladimir                            mailto:vladimir@thecybershadow.net
> 
> I wonder why we even have this operator in the language if we're supposed to avoid it all the time.

There's no problem with using it, generally-speaking. And it's actually faster than it used to be, so it's less of an issue. The problem really only lines with a tight loop. Extra checks have to be made with ~= to verify that reallocation isn't needed which don't have to be made with Appender, because it's able to make assumptions that ~= can't make. So, if you're in a loop that appends over and over for a large number of iterations, it's going to be faster to use Appender. Other than that, ~= is plenty fast enough.

- Jonathan M Davis
« First   ‹ Prev
1 2