Optimize multithreading in Krita's Tile Manager
Closed, ResolvedPublic

lieroz created this task.May 2 2018, 12:49 PM
Restricted Application added a subscriber: woltherav. · View Herald TranscriptMay 2 2018, 12:49 PM
dkazakov updated the task description. (Show Details)May 15 2018, 6:36 AM

@lieroz, I've just run into a bug with your implementation. I've reported it as bug 396467, including a video of the issue.

@lsegovia, thanks for reporting it. I managed to reproduce locally, that video helped a lot. I will dig in it for sure

Current project state: I guess that project is done by 2/3. I managed to add lock free hash table to fix thread waiting on blocking one, there are still some bugs there that I'm currently trying to fix. That was the first part. Then there were 3 locks in KisTiledDataManager class, they also were fixed and tested. The last one is associated with scheduling jobs, there are 4 hotspots that had to be fixed, I managed to get rid of 2 of them, but last 2 are quite deeply connected with scheduling algorithm. I tried making classes lock free and introduce RW locks, but it was a week of segfauls and errors... There is some work on that, but last 2 spots are really tough, maybe they must be fixed on higher level by introducing new interfaces.

rempt added a comment.Aug 11 2018, 6:21 PM

I think you're doing a great job, and I hope you will continue doing the job, even though pencils down is around now :-)

Here are some drafts on performance gain during different coding period:
My PC (2 cores 4 threads): https://docs.google.com/spreadsheets/d/1744goPIfc51j49Nlm8othm2599ozOAYEICV64wabKYk/edit#gid=0
Black monster (10 cores 20 threads): https://docs.google.com/spreadsheets/d/1lmrh37o_nPkRjFCjCEaqyuX0UyIhNC3VxIjMvhmK1c4/edit#gid=0

Vtune output with all latest fixes.

woltherav closed this task as Resolved.