Viewer Opens Slow

Started by Mees Dekker, February 26, 2025, 04:16:49 PM

Previous topic - Next topic

Mees Dekker

One thing I noticed, is when I send a picture from the file window to the viewer, it takes much longer (>10 seconds) than before (IMatch 2023) to see it on the screen. Peek preview is almost instantly. In IMatch the viewer was as fast as the Peek preview (almost instantly).

Both database and the picture are on the same internal SSD drive, which has some 350 Gb of free space.

I have made the necessary changes to my virus checker, after installing IMatch 2025

Could this be related in any way?

Mario

I don't think so. Can you make a debug log from an IMatch session where you encounter this? So we get some timing info?
I have not experienced this and there are no similar reports.

How many files do you show in the Viewer? Multiple side-by-side  layout?
Which panels have you open in the Viewer? Categories Panel? Annotations Panel?

axel.hennig

Quote from: Mees Dekker on February 26, 2025, 04:16:49 PMOne thing I noticed, is when I send a picture from the file window to the viewer, it takes much longer (>10 seconds) than before (IMatch 2023) to see it on the screen. Peek preview is almost instantly. In IMatch the viewer was as fast as the Peek preview (almost instantly).

I'm observing the same. Opening the Viewer takes much longer than before (IMatch 2023).

Maybe we should split this post, because two different topics.

axel.hennig

Quote from: Mario on February 26, 2025, 04:32:25 PMHow many files do you show in the Viewer? Multiple side-by-side  layout?
Which panels have you open in the Viewer? Categories Panel? Annotations Panel?

How many files do you show in the Viewer? Less than 100, somtimes less than 10.

Multiple side-by-side layout? No

Which panels have you open in the Viewer? Categories Panel? Annotations Panel? Categories Panel and Film Strip.

Mario

Quote from: axel.hennig on February 26, 2025, 04:36:19 PMWhich panels have you open in the Viewer? Categories Panel? Annotations Panel? Categories Panel and Film Strip.
What happens if you close both panels, then the Viewer and open it again? Any change?
Also, the log file in debug logging mode (see log file) is needed for a minimum of information to work with.

For a 100K files database, and a File Window with 400 files, it takes about 3 seconds to open the Viewer. Film strip and collection overlay visible. How long does it take on your PC?

Mees Dekker

Usually I have the flimstrip, annotation panel and statusbar open.

When I close all panels in the viewer, I notice only a minor improvement. Opening the viewer took 12 seconds, after closing all panels (including filmstrip) and the viewer, I reopened the viewer and then it took some 10 seconds to open just 1 jpg file.

I have 117 files in the file window and only 1 is send to/shown in the viewer. My database contains almost 160.000 files. 

A logfile in debug mode is attached.

axel.hennig

#6
Not sure if I've spotted correctly, but your first "open Viewer" took 9203ms and your second "open Viewer" (with all panels closed) took 8140ms.

02.27 08:33:22+    0 [1D20] 10  M>  <  0 [9203ms #sl] CViewWndDatabase::CreateViewerWnd
02.27 08:34:43+    0 [1D20] 10  M>  <  0 [8140ms #sl] CViewWndDatabase::CreateViewerWnd

I've also tested this and my times are 4328ms and 750ms. But this on a very small test-DB (only 77 jpg-files). Will also test with a larger DB.

But in general: I also had the "feeling" that it takes longer to open images in the Viewer compared to IMatch 2023.

Edit: Your Computer - in general - seems to be faster than mine (Number of processors 24 vs 12 and same amount of memory: 32GB)

Tveloso

I'm not seeing the slow start to the Viewer here (although I do see an occasional subsequent performance drop while using the viewer, as discussed in another thread - but it's intermittent).

My perception is that it might be just slightly slower to open the Viewer in IMatch 2025, than it was in IMatch 2023, but its still pretty quick for me.  I tested sending both one file, and 300 files, to the Viewer, and there was no appreciable difference between the two.  Sending 300 files took 2.09 seconds:

[2094ms] CViewWndDatabase::CreateViewerWnd
...and one file took just under that, but about the same (1.969 seconds):

[1969ms] CViewWndDatabase::CreateViewerWnd
My PC has a second discrete GPU, and in my ignorance, it was not being used for IMatch.  So I added that preference in Windows:

    Screenshot 2025-02-27 093738.png

and then repeated this test. 

To my surprise, it was actually slightly slower to open the Viewer with the "high performance" GPU configured (but not really measurably so).  And it was slower to open one file, than to open the 300.

Sending 300 Files took 3.39 seconds:

[3390ms] CViewWndDatabase::CreateViewerWnd
...and one file was 3.469 seconds:

[3469ms] CViewWndDatabase::CreateViewerWnd
(I'm pretty sure I don't have those reversed)...
--Tony

Tveloso

I just wanted to report (for anyone reading this topic later) that the GPU configuration change I mentioned here, is not an appropriate thing to do, as Mario explained:
Quote from: Mario on February 27, 2025, 04:33:47 PMIMatch ist not a game and will not benefit much (or at all) from running on the NVIDIA instead of the Intel GPU.
IMatch uses DirectX to render images in the Viewer, Quick View Panel and Slide Show. But displaying an image on screen is peanuts for modern GPUs.

You can force Windows to use the NVIDIA card for rendering, but that will not make things faster, just use more power.

Thank you for setting me straight on that Mario.
--Tony

Mario

#9
I've looked at the log Mees has attached and I see this:

Quote02.27 08:33:15+    0 [1D20] 05  M>  <  0 [234ms] CIMDXCacheManager::Start
02.27 08:33:22+ 6860 [1D20] 10  M> >  0 CIMViewerWnd::SetLayout  'V:\develop\IMatch5\src\IMatchNG\IMViewerWnd.cpp(3539)'
02.27 08:33:22+  15 [1D20] 10  M>  <  0 [15ms] CIMViewerWnd::SetLayout

When the Viewer opens, it initializes a "cache manager" that is responsible for loading and pre-loading images in the background, using WIC and DirectX to directly load images into the GPU memory.

Once this is done, the Viewer updates internal properties, which includes calling SetLayout.
The only thing between cache manager Start and SetLayout is determining the current monitor via a Windows function call.

Nothing of this should take much time. And this code is unchanged between 2023 and 2025.

On Mees' machine, there is a almost 7 second pause between the cache manager start completed and the call to SetLayout.
On my computers there is a 15 millisecond (!) pause. I've checked on my workstation and on my laptop.

Mees: Do you use multiple monitors perhaps?  Any special monitor layout? Maybe a second monitor unplugged but not disabled in Windows itself?

Which panels are open in the Viewer (Categories, Histogram, Favorites, ...)?


Mees Dekker

Yes I do use 2 monitors, each 1920 x 1200 px. DellU2412 and EIZO CG247X. No special lay-outs. No open panels in the viewer. 

But Imatch is only using the Dell monitor (2nd monitor is used for PS). 

What puzzles me is that Peek Preview is almost instantly responding but the viewer, that uses the same technique/components (dixit Mario), has a 7 seconds pause. Why this difference?

And I did not have this "problem" in the previous versions (2023). On my travelling laptop, there is no pause. 


sinus

Without to measure, I see no difference between 2023 and 2025. 
The viewer is very quickly. 

Hm, hopefully, that the mystery on Mees' computer will be solved. 
Best wishes from Switzerland! :-)
Markus

Mario


QuoteWhat puzzles me is that Peek Preview is almost instantly responding but the viewer, that uses the same technique/components (dixit Mario), has a 7 seconds pause. Why this difference?
They use the same caching, pre-loading and display technology.
The difference, as far as I can tell without logging each individual line of code, is the call the Viewer makes to determine the active monitor. This is what happens between the Start of the cache manager and the SetLayout code.

Maybe try this: Move IMatch to your main monitor, Viewer to. Power of or even unplug the other monitor. Maybe there is a change?

Problems like this which appear to happen on one or two PCs, are very hard to track down. Especially when all we see is "And here IMatch does nothing for 7 seconds, and then it opens the Viewer". This is where guesswork begins...

I have two 4K monitors myself, and I work with both of them most of the time. I keep the Quick Preview Panel and Viewer on the left monitor and IMatch on the right monitor. But I don't get the same pause you experience when opening the Viewer on your system. I use a 4K monitor for my laptop, again usually keeping the Viewer on the 4K monitor.  Just tried, but I don't get this obscure pause. Typical type for CViewWndDatabase::CreateViewerWnd is about 800ms.

axel.hennig

Quote from: Mario on February 27, 2025, 05:08:27 PMOn Mees' machine, there is a almost 7 second pause between the cache manager start completed and the call to SetLayout.
On my computers there is a 15 millisecond (!) pause. I've checked on my workstation and on my laptop.

On my Laptop this pause is almost 3 seconds (also far away from 15 milliseconds) and all additional panels are disabled. There are no further Monitors plugged-in and the Windows-settings also does not show further Monitors.