Hi Bartosz,

Thanks for the patch.

On út 7. července 2009, Bartosz Zaborowski wrote:
> Hi all,
>
> I've rewritten some code of image loader to get real performance gain from
> threads on SMP machine. Threads support exist in geeqie since around rev
> 1100, but in fact, there are up to 2 simultaneously running threads - main
> (for GUI) and only 1 for image loader. And GUI doesn't do anything
> cpu-intensive.
>

The patch looks good in general. Maybe you could simplify the code in 
view_file.c and move the code for managing multiple loaders to thumb.c.


> With this patch geeqie runs a few simultaneous threads for image loaders
> while it loads image for main view and makes thumbnails in main list.
> Number of threads depends on MAX_THREADS constant (currently located in
> main.h, but it should probably be determined in configure somehow - I'm not
> familiar with automake etc). Low prio tasks (making thumbnails) runs in up
> to MAX_THREADS threads. When high-prio task arrives, some of the low-prio
> are stopped - so when MAX_THREADS=1 you get exactly the old behavior.
>
> It seems that MAX_THREADS should be set to number_of_cpus+1, with that
> value I've got best performance.
>

Best option would be to autodetect the number of cpus in runtime.


> I haven't modified the search and duplicates dialogs with their thumbnails
> loading methods - maybe I'll rewrite them later (I don't understand why
> there is more than 1 separate mechanism for making thumbnails?).
>

The long-term plan is to drop the duplicated code and use view_file.c for 
everything.


> And I did some tests: after modification on 2core CPU I've got about 185%
> of initial performance, and when MAX_THREADS=1 we get sth which is not
> worse than original geeqie.
>
> There are also some minor modifications in file reading - I've added
> madvise call to force readahead of mmaped file (with many threads its
> really important) and increased a bit "read buffer" - it gives a little
> performance gain for free.
>
> I hope somebody will enjoy my work;)
>
> PS. I know its not the best time to post such patch, since you are
> releasing 1.0, but it's also a part of a project for my course at high
> school;) PS2. I'll be offline from 9.07 to ~28.07, so I won't answer for
> any comments those days.
>

I'd rather wait with adding the patch after 1.0, since it is a non-trivial 
change.

Thanks,

Vladimir







------------------------------------------------------------------------------
_______________________________________________
Geeqie-devel mailing list
Geeqie-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geeqie-devel

Reply via email to