Boost logo

Boost :

Subject: Re: [boost] [threadpool] parallel_sort example
From: vicente.botet (vicente.botet_at_[hidden])
Date: 2009-03-02 16:59:59


----- Original Message -----
From: <k-oli_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, March 02, 2009 10:05 PM
Subject: Re: [boost] [threadpool] parallel_sort example

>
> Am Sunday 01 March 2009 22:53:14 schrieb vicente.botet:
>
>> Oliver you are free to take this as example for the ThreadPool
>> documentation, if you consider this can improve the understanding of what
>> can be done with your library.
>
> Hi Vicente,
> I've executed your parallel_sort2.cpp with NN = 10000000 on a core 2 duo E6600
> (with BOOST_BIND_WORKER_TO_PROCESSORS, BOOST_DISABLE_ASSERTS and -02)
>
> std::sort: reverse 0..10000000 158 milli seconds
> std::sort: 0..10000000 148 milli seconds
> boost::sort: reverse 0..10000000 158 milli seconds
> boost::sort: 0..10000000 148 milli seconds
> parallel_sort 5000000: reverse 0..10000000 145 milli seconds
> parallel_sort 5000000: 0..10000000 121 milli seconds
> parallel_sort 2500000: reverse 0..10000000 169 milli seconds
> parallel_sort 2500000: 0..10000000 148 milli seconds
> parallel_sort 1250000: reverse 0..10000000 190 milli seconds
> parallel_sort 1250000: 0..10000000 166 milli seconds
> parallel_sort 625000: reverse 0..10000000 201 milli seconds
> parallel_sort 625000: 0..10000000 184 milli seconds
> parallel_sort 312500: reverse 0..10000000 216 milli seconds
> parallel_sort 312500: 0..10000000 203 milli seconds
>
> I've added your example - thx.
>

Just to comment some variations

With 4 threads I get the following results:

std::sort: reverse 0..400000 37 milli seconds
std::sort: 0..400000 35 milli seconds
boost::sort: reverse 0..400000 36 milli seconds
boost::sort: 0..400000 34 milli seconds
parallel_sort 200000: reverse 0..400000 39 milli seconds
parallel_sort 200000: 0..400000 22 milli seconds
*parallel_sort 100000: reverse 0..400000 26 milli seconds
*parallel_sort 100000: 0..400000 26 milli seconds
parallel_sort 50000: reverse 0..400000 30 milli seconds
parallel_sort 50000: 0..400000 28 milli seconds
parallel_sort 25000: reverse 0..400000 30 milli seconds
parallel_sort 25000: 0..400000 32 milli seconds

With 6 threads
std::sort: reverse 0..400000 40 milli seconds
std::sort: 0..400000 36 milli seconds
boost::sort: reverse 0..400000 36 milli seconds
boost::sort: 0..400000 39 milli seconds
parallel_sort 200000: reverse 0..400000 43 milli seconds
parallel_sort 200000: 0..400000 21 milli seconds
* parallel_sort 100000: reverse 0..400000 25 milli seconds
* parallel_sort 100000: 0..400000 31 milli seconds
 parallel_sort 50000: reverse 0..400000 31 milli seconds
 parallel_sort 50000: 0..400000 30 milli seconds
 parallel_sort 25000: reverse 0..400000 30 milli seconds
 parallel_sort 25000: 0..400000 30 milli seconds

These results seems extrange to me for an algorith that do not have IO, and no synchronization between tasks.

Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk