Review Request: Implemented multithreading in KFileItemModelSortAlgorithm

Emmanuel Pescosta emmanuelpescosta099 at gmail.com
Thu Oct 25 12:04:26 BST 2012



> On Oct. 25, 2012, 10:33 a.m., Mark Gaiser wrote:
> > dolphin/src/kitemviews/private/kfileitemmodelsortalgorithm.cpp, line 74
> > <http://git.reviewboard.kde.org/r/107025/diff/1/?file=92240#file92240line74>
> >
> >     Why is this fixed to two threads? You can use http://qt-project.org/doc/qt-4.8/qthread.html#idealThreadCount (like you did to even decide if you want to use threading) spread the sorting over the number of threads available.

Yes I already did that. See my description ;) "I also have a patch which uses n Threads for sorting, if you want test it"

According to my tests (with 500.000 and 1.000.000 files), the fixed-two-thread implementation is faster than the n-thread implementation (for 500.000 files about 400 ms). But I can upload the other patch, if you want test it.


- Emmanuel


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107025/#review20857
-----------------------------------------------------------


On Oct. 24, 2012, 5:20 p.m., Emmanuel Pescosta wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107025/
> -----------------------------------------------------------
> 
> (Updated Oct. 24, 2012, 5:20 p.m.)
> 
> 
> Review request for Dolphin and Frank Reininghaus.
> 
> 
> Description
> -------
> 
> Implemented multithreading in KFileItemModelSortAlgorithm.
> 
> If more than 100 items to sort and ideal thread count is greater than 1 -> sort them with parallelSort (2 Threads)
> 
> Use maximal 2 Threads, because more than 2 Threads are "slower" (more overhead than speed up). (I also have a patch which uses n Threads for sorting, if you want test it ;)
> 
> 
> Diffs
> -----
> 
>   dolphin/src/kitemviews/private/kfileitemmodelsortalgorithm.h 3a596df 
>   dolphin/src/kitemviews/private/kfileitemmodelsortalgorithm.cpp e0aac13 
> 
> Diff: http://git.reviewboard.kde.org/r/107025/diff/
> 
> 
> Testing
> -------
> 
> About 2 seconds faster with sorting 500.000 files.
> About 5 seconds faster with sorting 1.000.000 files.
> 
> 
> Thanks,
> 
> Emmanuel Pescosta
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20121025/71d01ad0/attachment.htm>


More information about the kfm-devel mailing list