Page 1 of 1

Possible Performance Issue

PostPosted: Mon Aug 24, 2009 4:33 am
by malch
I'm running FPV on Windows XP with SP3 and browsing a folder of fairly large (~8MB) JPEG's.

From time to time FPV will become very unresponsive for a period -- maybe 10 seconds.

Task manager suggests that it's busy working on pre-fetches. But it seems to want to complete ALL of the queued pre-fetch operations before it will respond to a whack of the space bar to display the next image. This doesn't appear to be the case all of time. It seems like the pre-fetch operations are non-interruptable some of the time. At other times, it will display the next image even though it appears to working through a list of pre-fetches simultaneously.

Disabling the pre-fetch option appears to solve the problem but I loose the benefits of the pre-fetch ;-)

I have tried turning off the GPU option and that didn't seem to help.

And although I have a 4 core system I do leave parallel pre-fetching off since that has caused other issues on this machine. Changing the more/less slider on the pre-fetch settings doesn't appear to make much difference.

If I hold down the space bar continuously, sometimes it will advance through the folder of images at around one per second. Other times, it will advance in bursts -- no new image for 10 seconds and then 10 images in 1 second. Again it suggests the pre-fetch thread is pre-empting the UI, sometimes.

I realize there has to be some locking and so forth but 10 seconds seems excessive on a reasonably fast machine -- Dell XPS 420 with 4MB RAM and two 7200rpm SATA drives (which have been defragged). It's a lot more than the time required to fetch and display one image.

Any suggestions for me? I'll respond promptly of you need any additional info.

Re: Possible Performance Issue

PostPosted: Mon Aug 24, 2009 12:22 pm
by Axel
If you work with large images it's easy to get caught expecting too much. I have no idea how much RAM your 8MB JPEGs are using, are they 2 megapixels images saved as 100% quality or 100 megapixels photos saved at 10% quality? The size on disk gives only a very vague indication of the decompressed size.

You can compute the memory consumption of one of your images quite easily (basically, Width x Height x 4 bytes), then see what's left in terms of resources on your machine and adjust the preloading to match. Start with the slider on the far left, then use the viewer for a while. If you hit the “Loading…” prompt too often at a normal viewing pace, try moving the slider a little to the right, and test again for a while, etc, until you find the spot that best matches your images, your viewing style and your computer's abilities (with too many large images in memory, at some point the machine will start trashing and performance will drop sharply).

Holding down the space-bar sends 30 "Next Image" clicks per second, if you expect the viewer to cope with that rate (with your large images), you need a much quicker computer (in particular, much faster disks: your SATA drives starts sweating at 5 or 6 images/sec already, from the size you indicated) and probably a lot more memory.

Re: Possible Performance Issue

PostPosted: Mon Aug 24, 2009 8:34 pm
by malch
It's almost like we're talking about different products!

The vast majority of my images are 3872 x 2592 Pixels; that's around 40MB per your formula. However, there are a few much larger panos in the collection I've been working with in the past few days and they may be making the problem worse.


1. Task Manager (Processes Tab) suggests that FPV is using only a tiny amount of memory. After quickly browsing dozens of images, Task Manager reports for FPV:
* Memory Usage: 5312K
* Peak Mem Usage: 63772K
* VM Size: 11268K

2. Task manager (Performance Tab) suggests that a total of only 0.5 out of 3GB RAM is in use.

I think maybe you're using a type of memory that Task Manager is not counting?

3. As mentioned in my original message, the position of the More/Less slider does not appear to have much influence on this problem. Yes, I am restarting the program after ALL changes to the Options settings. However, I did play with this some more this morning. With the slider at the extreme left, FPV appears to prefetch one image only and things are a little better and more consistent. With the slider to the extreme right, it appears to prefetch 12-14 images. 3872 x 2592 x 4bytes x 14images is around 0.5GB. That's well within the 3GB of RAM available on the machine. More importantly it's well within the 2GB per process limit that I understand applies on 32-bit XP. I can get CS4 to consume around 1.7GB as reported by Task Manager.

FYI, I normally run with the More/Less slider at around 25% of the way from the left hand edge.

4. What is this "Loading..." prompt? I have never seen such a thing after using FPV almost every day for months.

5. And, no, I'm absolutely not expecting FPV to render 30 large images per sec. One per sec is okay (for images of this size) although 2-3 would be better. However, there are times when it takes 10 seconds before I get a response to a next image request. Heck, I can start Photoshop and open manually open the image in that amount of time.

As it happens, I have the same set of images downsized to approx 1 MPixel. I have browsed those holding down the space bar and got through all 355 images in around 25 seconds. That's around 14 per second, which is way faster than I need or expect.

I think my expectations are very reasonable.

6. Having 10 seconds of dead time is really frustrating. Now, there is one pano is this collection sized 13954 x 3199 Pixels; FPV reports 44.6 MP. But I can launch FPV and render that image in under 5 seconds. Irfanview (without color mgt) will load it in 2. So, I see no reason why there should be 10 second dead spots browsing this collection.

I should stress, these 10 second dead spots do not arise all of the time; far from it. It is seemingly random but will generally occur at least once in browsing a folder of say one hundred 10MP images.

And although having a few larger pano images in the collection does appear to make matters worse, these 10 second dead spots arise with folders containing only images that are 10MP or smaller crops of 10MP images.

7. This machine is squeaky clean -- fresh Windows install on Saturday -- including SP3 and everything else available from Windows Update. Subsequently defragged, virus checked, etc.

So, something weird is going on with prefetch and I'll take a guess that it's specific to XP (or you would have noticed it by now).

Re: Possible Performance Issue

PostPosted: Mon Aug 24, 2009 11:34 pm
by Axel
Ineresting issue. For comparison, I'm loading a 13954 x 3199 pixels panorama-sized image (44.6 Megapixels, taking up 170 MB of memory) like the one you described in 1.4s (GPU and auto rescaling OFF). Just for fun I copied 112 of those panorama sized images and FPV opened the folder like it was nothing, with the preload slider at about 1/3. The program used 5.7 GB of RAM and I could scroll through the 112 images without any delay. All this on a vanilla $600 midrange desktop PC: Q8200 2.33GHz, 8GB, Windows 7 x64. I believe the program works fine but some of the components it uses have been vastly improved on subsequent versions of Windows.

Re: Possible Performance Issue

PostPosted: Tue Aug 25, 2009 12:51 am
by malch
Interesting indeed.

I made a few copies of that large image and played around briefly:

1. Now, if I turn off the GPU, I can see FPV using gobs of RAM in task manager. So, I guess you're loading the pre-fetched images straight into the video card when GPU is enabled? Preloading them into Windows RAM when GPU is disabled?

2. With the GPU off, things do seem smoother.

Therefore, I think my 10 second pauses likely result from an interaction of the prefetch and the video system memory management (which I imagine is hairy).

So, what I did was.... turn off the GPU and adjust the pre-fetch slider so that MAX memory in use per Task Manager is around 300MB (versus 512MB in my video card). This places the slider at about 10%. Then I turned the GPU option back on. Based on a quick test, this seems to be working reasonably smoothly plus the GPU is saving precious Windows RAM and presumably helping out with pan and zoom and more.

My video card is a nVIDIA GeForce 8800 GT with 512MB. I'm running the latest certified drivers from nVidia. This could be a video driver issue (I know how bad some of them are) although the nVidia drivers are about as good as it gets, IMO.

What does FPV do if prefetching when the video card memory is full? Task Manager suggests that FPV is still pre-fetching files from disk well past the point at which the video memory has surely been filled up.

Tweaking the prefetch slider such that the memory required is less than the memory available on the video card certainly seems to help me. Hopefully, it may help some other users too! Obviously, this isn't very useful if the image sizes are unpredictable. But most of my images come from the same 10MP camera and I'm sure plenty of other users are in a similar situation.

Re: Possible Performance Issue

PostPosted: Tue Aug 25, 2009 1:20 am
by Axel
Yes everything tends to works better with relatively uniform image sizes. It makes it easier to predict what comes next. The program does it's best to adapt to available resources but if there is a sudden five-fold increase in image size in the stream it may cause some issues, like an urge to make room which may discard images that were just loaded, causing efficiency to drop..

The problem is aggravated when using the h/w acceleration mode, which is bound to use the relatively limited video memory space. Anyway, the technique you used is basically the right one: start slowly, then increase little by little and performance will increase - up to a point. You can also experiment with the automatic resizing. For example your 14000 pixels wide panoramas takes up 170MB of RAM, a big chunk of the video memory.

With automatic downsizing you can reduce the memory consumtion (at some load speed expense as rescaling takes some time) but the images will be easier on the video ram. If you set the value to, say, "64MB (Fast)" your panoramas will use much less memory (you will still get about 16 megapixels to look at) and this will not affect your other, normal resolution images. If you set the value to 48MB you'll end-up will approx. 12 megapixels, still a confortable viewing size and there will be room for about 9-10 picture instead of 2.

The real solution to the huge image problem is to move to x64. On my machine (currently with a $60 ATI 4650) the driver maps 3GB of system ram as video memory, for a total of 3.5GB. That's a lot more fun. I recorded this short demo on my midrange 64-bit system (an HP Pavillion, nothing fancy):

Re: Possible Performance Issue

PostPosted: Tue Aug 25, 2009 2:23 am
by malch
Ahhh, thanks, that's helpful.

You might want to provide a little more explanation for the GPU and Automatic Resizing options in the UI and/or docs. I certainly didn't quite "get it" until now and I'm a lot better at RTFM than most users ;-)

Specifically, I didn't appreciate that pre-fetched images were decompressed and stored in the video memory with the GPU option. Once you understand that, the role and importance of the Automatic Resize clicks into place.

As for a 64-bit system... that will need to wait for Windows 7 SP1 and a new machine. If the economy picks up, maybe I can throw some really fast disks at the problem too!

I'm afraid MS really botched things up with Vista and their initial 64-bit work. I'm sure they will get there but they lost my confidence on the way and a lot of other folks too. Until that's really solid, I'll stick with my trusty 32-bit XP.

Provided I can avoid the 10 second dead spots with 48MB on the auto resize, GPU, and a modest pre-fetch setting, I'll be a happy camper.

Re: Possible Performance Issue

PostPosted: Tue Aug 25, 2009 3:11 am
by Axel
Yes I'm sure you'll find a good compromise for your particular needs, images and system.

Clearly the advanced settings would benefit from being better described, but on the other hand I believe that the default performs quite well for the average cases so I hope that most users never need to tweak those settings.

Besides that, Vista 64 is absolutely rock-stable, this is *by far* the most stable and robust Windows ever (actually, more stable than the Win 7 Release Candidate everyone in bragging about). I'm now running the final Windows 7 on all computers and they got it right: is just as solid as Vista (which is no small fact for a new release) and shows some performance improvements in certain areas so it's a nice to have update but if it was not for the bunch of new APIs exposed by the latest version, I'd see that many compelling reasons to upgrade.

Re: Possible Performance Issue

PostPosted: Tue Aug 25, 2009 3:38 am
by malch
Axel wrote:I'm now running the final Windows 7 on all computers and they got it right:

Good to hear. But it's not just MS of course. Lots of hardware manufacturers have to produce some stable drivers, and then there's the applications too. I'm glad your experience has been so positive especially with an ATI video card! I dumped mine for a Nvidia because that thing gave me blue screens every day and Google showed that I was one of a huge number.

Let's hope Windows 7 really does live up to expectations a lot better than Vista. I'm not a big fan of MS but if Windows 7 works as well as some think, it will be GREAT news for a LOT of users!

And maybe I'll get a lot fewer calls for help from friends, family and colleagues ;-)

Re: Possible Performance Issue

PostPosted: Tue Aug 25, 2009 1:23 pm
by Axel
Don't get me wrong: Vista is great, it's a huge step up from XP in all respects and Windows 7 only slightly improves on that. For Vista SP2 users there are actually few reasons to update. The big step is to leave 10-years old XP.

Besides that the ATI card came with the PC, and I had it freeze my machine a couple of times already. The driver is a stock driver that comes "in the box" with Windows 7, but it was provided by ATI.