[haiku] Re: Thumbnail generation feedback

  • From: "Adrien Destugues" <pulkomandy@xxxxxxxxxxxxx>
  • To: haiku@xxxxxxxxxxxxx
  • Date: Tue, 08 Feb 2022 21:58:51 +0000

8 février 2022 16:19 "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx> a écrit:

Hi Humdinger,

Am 08.02.2022 um 14:35 schrieb Humdinger (humdingerb):

On Mon, 7 Feb 2022 19:59:16 -0500 John Scipione wrote:
Hey I just wanted to say that this feature is now working pretty well
for me now, [...]

It doesn't for me. If I activate the setting in Tracker prefs and open a 
folder with 50
JPGs, all cores are pegged with 2 or 3 dozen threads and my fan spinning in 
overdrive.
It only stops when I close that window...
This is with hrev55827, 64bit.
I know, I should open a ticket for that... :)

It's even worse than that! It will try to create the thumbnail of *all* 
images in that folder at
the same time.
Which means that it'll take roughly a gazillion bytes to do so, which means 
many threads will
simply fail to deliver any output at all.

One should be able to steal a lot of code from ShowImage which does limits 
the amount of images it
tries to load at once.

For the package kit we added the classes BJob and JobQueue which should help 
with that kind of thing,
create one BJob for each icon to be generated, and a JobQueue to queue them all.

Then you run one thread per CPU core (there is no need for more than that) and 
have each thread pop
jobs from the queue and run them, until the queue is empty.

There could be one queue per window or one global queue for all of Tracker, as 
you prefer.

Once this is implemented, the queue can also be used for other jobs, such as 
scanning the MIME type
of files which are not identified yet.

-- 
Adrien.


Other related posts: