No multi-threading thumbnail creation?

Ask for help and post your question on how to use XnView MP.

Moderators: XnTriq, helmut, xnview

Timur Born
Posts: 25
Joined: Thu Apr 28, 2022 9:35 am

No multi-threading thumbnail creation?

Post by Timur Born »

Hello.

Is it correct that XnViewMp does not use multi-threading for thumbnail creation? I do not mean multiple threads per single image, but multiple images/thumbnails being processed concurrently.
User avatar
xnview
Author of XnView
Posts: 44449
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: No multi-threading thumbnail creation?

Post by xnview »

currently, there is no mutli-threadring for thumbnail creation
Pierre.
Timur Born
Posts: 25
Joined: Thu Apr 28, 2022 9:35 am

Re: No multi-threading thumbnail creation?

Post by Timur Born »

Too bad. Once the catalog is built it doesn't matter much, but for non-catalogued folders it is one of the things I miss in most image viewers out there (there is one simple QT based one that used multi-threading for thumbnails, but most do not).
User avatar
xnview
Author of XnView
Posts: 44449
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: No multi-threading thumbnail creation?

Post by xnview »

Timur Born wrote: Thu Apr 28, 2022 3:04 pm (there is one simple QT based one that used multi-threading for thumbnails, but most do not).
which one?
Pierre.
Timur Born
Posts: 25
Joined: Thu Apr 28, 2022 9:35 am

Re: No multi-threading thumbnail creation?

Post by Timur Born »

Nomacs Image Lounge. It builds thumbnails blazingly fast due to multi-threading.

https://nomacs.org/
Timur Born
Posts: 25
Joined: Thu Apr 28, 2022 9:35 am

Re: No multi-threading thumbnail creation?

Post by Timur Born »

Multi-threaded thumbnail building can be problematic for spinning platter drives and for very large images in network folders (I have some gb sized ones that max out my gbit LAN). But for any sanely sized images on SSD or NAS it makes a big difference.
Timur Born
Posts: 25
Joined: Thu Apr 28, 2022 9:35 am

Re: No multi-threading thumbnail creation?

Post by Timur Born »

One big advantage of a multi-threaded browser is that the application does not stall (seemingly freeze) while thumbnails are created. All operations are still possible while threads are working in the background. Xn mostly doesn't suffer from this, but sometimes it does.

Another advantage is with loading compressed images (tif, png) where XnViewMP seems to get bottlenecked on the memory management rather than CPU or storage bandwidth. Xn uses fantastically little memory to build thumbnails of huuuuge images, but due to it being single-threaded it can happen that neither CPU (single core) nor storage bandwidth are maxed out.

But here comes the strange part: XnViewMP is multi-threaded for thumbnail creation of JPEG files?! All my latest tests where on tif and png files, but I had the nagging memory that I saw Xn being multi-threaded for thumnail creation in the past and this might be why?!
XN_multi_jpeg_thumbs.png
You do not have the required permissions to view the files attached to this post.
User avatar
helmut
Posts: 8705
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: No multi-threading thumbnail creation?

Post by helmut »

Some comments from my side:
  • While building thumbnails for a specific folder XnView MP is still responsive. I.e. you can navigate to another folder and start actions or open an image, for example.
  • The bottle-neck in thumbnail creation can be the processor but another bottle neck is file input/output (file i/o). So multi-threading might help in some cases (e.g. if you browse a really fast SSD) but it might not help too much.
  • JPEG images often have an embedded thumbnail and XnView MP uses this embedded thumbnail for displaying. That means that only a part of the image must be read. This might be another case were file i/o is not the limiting part.
All in all: Multi-threading is not supported by XnView MP. Multi-threading might speed up thumbnail creating if file i/o is not the limiting factor.
Timur Born
Posts: 25
Joined: Thu Apr 28, 2022 9:35 am

Re: No multi-threading thumbnail creation?

Post by Timur Born »

File I/O is not the limiting factor here, which is why I am hoping for more image applications to implement multi-threading for thumbnail creation.

Xn uses multiple threads and maxes out my CPU for single folders full of JPEG files, but I don't know what exactly happens there.
waverly
Posts: 4
Joined: Fri Jul 08, 2022 6:15 pm

Re: No multi-threading thumbnail creation?

Post by waverly »

Hello! Longtime XnView / XnView MP user. Wonderful software.

Today I was watching XnView MP take several minutes to generate thumbnails on several very large folders. I have one of the fastest CPUs available, 12 cores / 24 threads, but XnView thumb generation can still take multiple minutes.

This thread confirmed my suspicion that it was not taking advantage of this machine's multiple cores/threads. It would be very cool if it could, like it can when processing batch image conversions.

Just my $.02. :)
Timur Born
Posts: 25
Joined: Thu Apr 28, 2022 9:35 am

Re: No multi-threading thumbnail creation?

Post by Timur Born »

helmut wrote: Sat Apr 30, 2022 3:41 pmAll in all: Multi-threading is not supported by XnView MP. Multi-threading might speed up thumbnail creating if file i/o is not the limiting factor.
It is for JPEGs, though.
Timur Born
Posts: 25
Joined: Thu Apr 28, 2022 9:35 am

Re: No multi-threading thumbnail creation?

Post by Timur Born »

Creating 2000 JPEG thumbnails in "Nomacs" viewer (multi-threaded, M.2 source):

8 HT P cores: 16 s
16 E cores: 25 s
8 HT P + 16 E cores: 12 s

1 P core in XnViewMP (single-threaded): 35 s
1 E core in XnViewMP (single-threaded): 55 s

Curiously JPEG thumbnail creation is not multi-threaded anymore, whereas it was in the past (see screenshot in earlier post).