On Tue, 07 Jul 2009 11:04:06 +0200 Laurent Monin <z...@norz.org> wrote:
> Bartosz Zaborowski a écrit : > > Hi all, > > > > > Hi, > > 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. > > > > 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. > > > > 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?). > > > > 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. > > > > -- > > bart > > > > > Thanks for this patch, i attached a version of it updated to match > latest revision (1796) for all to test. > > I didn't have the time for now to test it in details, but it looks > interesting. Thanks for this patch, Bartek! I patched rev. 1796 and Geeqie compiled fine. I gave it a try with MAX_THREADS set to 3 and 4 (on CPU with 2 cores) and it seems to run a little bit faster. Unfortunately it's hard to say if its mentioned 185%. Is there an easy way to make some benchmark? Besides thumbnails in the main list should I expect to have main image loaded (and shown) almost 2x faster (for no cached images)? Or the second (cached) image should be loaded faster? Regards Marcin ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Geeqie-devel mailing list Geeqie-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geeqie-devel