A new Speed Algorithm for image opening in large folders

Ideas for improvements and requests for new features in XnView MP

Moderators: helmut, XnTriq, xnview

Post Reply
User avatar
budz45
XnThusiast
Posts: 1621
Joined: Sun Jun 03, 2007 6:05 pm
Location: UK

A new Speed Algorithm for image opening in large folders

Post by budz45 »

Hello forum, it's budz

--------------------
My system:- Windows 7 sp1, dual-core AMD athlon
--------------------

Ok, I boot up my Windows 7 system as normal and opened up my favorite file manager that I use. From my file manager app, I have a folder which contains 4,800 image files and here are my feedback findings:

When I double-clicked on 1 image file (out of the 4,800 file-list) for opening with XnViewMP 0.48 it took a disappointing 27 seconds for XnViewMP to open and display the picture in view :shock: .

When I closed XnViewMP and double-clicked on the same file again it took exactly 21 seconds plus with a further disappointment the XnViewMP program window did not display on top of my other program windows...

...Hmmm....Right, I then decided to close XnViewMP program for a moment...

...Then I decided to right-click on the same image file and do an "Open with" to open with MS Paint --->and the file opened instantaneously with a 0.5-1 second fast delay :) :D I thought to myself this is how fast XnViewMP should always be even on a first app run after OS boot.

Right so I thought to myself, the issue causing this deficiency is because XnViewMP (like many image viewers) is scanning the large folder being used, and adding what it finds to the DB, background 'Browser' work as well as building a complete file-list of the folder directory everytime.

Now what if XnViewMP directory file reading algorithm for view mode was to be changed in a manner similar to the already "Lazy loading" of Thumbnails feature! ...Meaning that this slowness would get eradicated or at least still greatly reduced so much that any user notices a new faster improvement.

This issue also has little to do with the file size of the image file. File size of image file is not the issue here according to my tests.

I also tried the method of disabling the Cache settings of "Read one image ahead" and "Keep current image" but this did not help. :( I also thought that the problem might be directly related to the modules of Qt and OpenGL loaded within XnViewMP but I then doubted this case after I did some further basic tests:

1.) I simply copied the same 1 image file to a 'New Folder' on my Desktop which contained 4 other image files...
2.) ..So in total 5 image files in this 'New Folder'...
3.) ...I open the same 1 image file now in this folder...
4.) The file now opens much more faster with a 1-2 second delay

[the 1-2 second delay now is about 0.5 seconds slower than when opening the same with XnView 1.9x]

5.) I closed the tab of the single file opened and then I minimized XnViewMP to the taskbar....
6.) Then again double-clicked on the same file in the folder to open...
7.) ....Tears almost came to my eyes when the same file opened in around 0.2 seconds :) :) .....

....I thought to myself that this is how XnViewMP should be and began to think of some ways in which this could be achieved, even if it was optional and not guaranteed to always work.......

....See below the dotted line for what I propose should exist for XnViewMP.

------------------------------------------------------------------------------------------------
What if XnViewMP could simply build a delayed file-list for after the picture is loaded and also be able to 'see' any folder directory as having a minimal amount of files (10 or less). I propose this as 5/5 file-list.

A method for XnViewMP to ALWAYS behave as if there is file-list of '5/5' when opening any image file from any folder in Win Explorer. So for a folder with 50 total image files to even 50,000 files, XnViewMP would always open much more super-fast because the status bar would display to the user 5/5 initially first and then after some short time (seconds) this 5/5 file-list would start to rapidly auto-count the true amount of files in the folder. This 'counting' of files would be reflected with a real-time display on the XnViewMP status bar with the file-list becoming a live number ticker .

The reason I propose an "Always treat file-list as 5/5" is so that XnViewMP would read/detect the Two Next images that are in the list after the Opened file as well as reading the Two Previous images of the list. This is important so that there is not a long program delay when a user immediately uses the "Next / Prev" commands to go to next or previous file after the single file gets opened.

Here is a brief diagram of what it would be like:

Code: Select all

2 files read<<--(previous)----------[FILE THAT IS OPENED]---------(next)-->>2 files read
2 + *1* + 2 = 5 = the 5/5 file-list method
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------

Finally, as well as the "5/5 file-list" loading method I explained above...

.....XnViewMP also needs to have three further important settings for:
Always display in system tray (Windows only)
Run in background process after program closing
Run in background process on system Startup
[topic:- http://newsgroup.xnview.com/viewtopic.p ... 87#p103387]

These three system settings would of course be cross-platform (linux, windows, mac osx) and would sit nicely as tickbox settings in the XnViewMP Settings>Integration . However, first these two system settings should be as an experimental Ini Tweak for beta testing.

XnViewMP ability to run as a minimal background process as well as system tray integration for Windows should greatly speed things up in my prediction. VLC media player has the ability to totally run in system tray with the "Hide taskbar" system tray feature and this is what I think must also come to XnViewMP too because with VLC media player HD video opens lightning fast when VLC is running as a background process as system tray.

----------------------------------------------------------------------------------------

SUMMARY of of this topic for what I think is needed:
= "5/5 file-list" loading method
= user setting: Always display in system tray (Windows only)
= user setting: Run in background process after program closing
= user setting: Run in background process on system Startup
All My Topics || my 'MP' Topics
My own Bookmarked topics--->for me only
User avatar
xnview
Author of XnView
Posts: 46257
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: A new Speed Algorithm for image opening in large folders

Post by xnview »

JPEG?

I've tried but no problem, perhaps my disk are too fast...
You have the problem only when XnView is started with a file?

(When you start XnView in view mode, the list of all files is readed too, and thumbnailing start...)
Pierre.
User avatar
budz45
XnThusiast
Posts: 1621
Joined: Sun Jun 03, 2007 6:05 pm
Location: UK

Re: A new Speed Algorithm for image opening in large folders

Post by budz45 »

xnview wrote:JPEG?
I have it with 'JPG' :)
xnview wrote:(When you start XnView in view mode, the list of all files is readed too, and thumbnailing start...)
XnViewMP is always slow when there is a folder with lots and lots of files (I have a folder of 4,000)...For me the full file-list of folder should be read with a delay, so I think only the first 5 files read ("5/5 method")
All My Topics || my 'MP' Topics
My own Bookmarked topics--->for me only
User avatar
xnview
Author of XnView
Posts: 46257
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: A new Speed Algorithm for image opening in large folders

Post by xnview »

How many core do you have?
Pierre.
User avatar
budz45
XnThusiast
Posts: 1621
Joined: Sun Jun 03, 2007 6:05 pm
Location: UK

Re: A new Speed Algorithm for image opening in large folders

Post by budz45 »

Dual-Core, AMD Athlon processor
All My Topics || my 'MP' Topics
My own Bookmarked topics--->for me only
Vapavite123
Posts: 215
Joined: Sat Jul 02, 2011 7:03 am

Re: A new Speed Algorithm for image opening in large folders

Post by Vapavite123 »

Hello,
xnview wrote:JPEG?

I've tried but no problem, perhaps my disk are too fast...
You have the problem only when XnView is started with a file?

(When you start XnView in view mode, the list of all files is readed too, and thumbnailing start...)
I can only confirm

Always and forever!
I did not venture to work in a folder of several thousand images and rarely visit it, too long :?

Fr :
Je ne peux que confirmer
Toujours et depuis toujours !
Je ne m'aventure pas à travailler dans un dossier de plusieurs milliers d'images et rarement de le visiter, trop long :?

@+
User avatar
budz45
XnThusiast
Posts: 1621
Joined: Sun Jun 03, 2007 6:05 pm
Location: UK

Re: A new Speed Algorithm for image opening in large folders

Post by budz45 »

Also I mentioned this 'revolutionary' idea here: http://newsgroup.xnview.com/viewtopic.p ... 49#p108141
All My Topics || my 'MP' Topics
My own Bookmarked topics--->for me only
Post Reply