RC2: Deleting files is extremely slow when cache is enabled

Bugs and Suggestions in XnView Classic which have been resolved

Moderators: XnTriq, xnview

Post Reply
User avatar
iycgtptyarvg
Posts: 81
Joined: Wed Jan 24, 2007 3:59 pm
Location: The Netherlands

RC2: Deleting files is extremely slow when cache is enabled

Post by iycgtptyarvg » Wed Jan 24, 2007 4:13 pm

When you have the cache setting on (to memorize the thumbnails for quicker browsing), the deletion of files is extremely slow.

To reproduce:
1. Have the 'Cache' option on.
2. Delete some (e.g., 10 pictures).

This didn't use to happen in v1.8x. This is so terrible that I'm currently forced to turn off this useful option.

PS
This can be reproduced on both RCs and also with the betas.

User avatar
xnview
Author of XnView
Posts: 33620
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: RC2: Deleting files is extremely slow when cache is enab

Post by xnview » Wed Jan 24, 2007 8:11 pm

iycgtptyarvg wrote:When you have the cache setting on (to memorize the thumbnails for quicker browsing), the deletion of files is extremely slow.

To reproduce:
1. Have the 'Cache' option on.
2. Delete some (e.g., 10 pictures).

This didn't use to happen in v1.8x. This is so terrible that I'm currently forced to turn off this useful option.

PS
This can be reproduced on both RCs and also with the betas.
If you have not the cache, the delete is quicker?? Do you have a big cache db?
Pierre.

User avatar
iycgtptyarvg
Posts: 81
Joined: Wed Jan 24, 2007 3:59 pm
Location: The Netherlands

Post by iycgtptyarvg » Thu Jan 25, 2007 9:49 am

Even when I delete the directories from the cache and go to 1 directory in XnView it's terribly slow to delete files. It also doesn't matter which type of compression I use (none/lossless zip/lossy high jpg/lossy low jpg).

Using Process Monitor (from www.sysinternals.com) I can see that after deleting the files you update the files XnView.db and XnView.db-journal.
There are a massive amount of reads where data is read 1024 bytes at a time. This is probably the setting of your buffer. This is WAAAAY too little. A file of e.g. 10MB would require 10240 I/O reads!

If you're using fread(), then please set the buffer to a reasonable size, e.g., 1MB as this will speed up things a lot.

PS
Remember, I didn't use to have this problem in v1.8x, so whatever you changed slowed it down.

User avatar
xnview
Author of XnView
Posts: 33620
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview » Thu Jan 25, 2007 11:05 am

iycgtptyarvg wrote:Using Process Monitor (from www.sysinternals.com) I can see that after deleting the files you update the files XnView.db and XnView.db-journal.
There are a massive amount of reads where data is read 1024 bytes at a time. This is probably the setting of your buffer. This is WAAAAY too little. A file of e.g. 10MB would require 10240 I/O reads!

If you're using fread(), then please set the buffer to a reasonable size, e.g., 1MB as this will speed up things a lot.
It's a database, so it's not me who use fread :-), but it's strange that so many I/O are needed...
Remember, I didn't use to have this problem in v1.8x, so whatever you changed slowed it down.
Yes, because delete file doesn't update cache, now there is an update...
Ok, i check...
Pierre.

User avatar
iycgtptyarvg
Posts: 81
Joined: Wed Jan 24, 2007 3:59 pm
Location: The Netherlands

Post by iycgtptyarvg » Fri Jan 26, 2007 2:31 pm

xnview wrote:Yes, because delete file doesn't update cache, now there is an update...
Ok, i check...
Instead of optimizing the database immediately, why not do this upon exiting XnView?
I do the same with the applications I develop; upon exiting I destroy the window(s) so the task is gone from the taskbar, and then do cleanup and optimizations etc. This way the user doesn't have to wait for it.

User avatar
xnview
Author of XnView
Posts: 33620
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview » Fri Jan 26, 2007 2:32 pm

iycgtptyarvg wrote:
xnview wrote:Yes, because delete file doesn't update cache, now there is an update...
Ok, i check...
Instead of optimizing the database immediately, why not do this upon exiting XnView?
I do the same with the applications I develop; upon exiting I destroy the window(s) so the task is gone from the taskbar, and then do cleanup and optimizations etc. This way the user doesn't have to wait for it.
But if you delete a file, i must update the db now, and not at the exit...
Pierre.

User avatar
iycgtptyarvg
Posts: 81
Joined: Wed Jan 24, 2007 3:59 pm
Location: The Netherlands

Post by iycgtptyarvg » Sun Jan 28, 2007 8:23 am

xnview wrote:But if you delete a file, i must update the db now, and not at the exit...
Ok, but deleting records from a database normally takes hardly any time; the records are only removed from the index (which is fast). Only when you optimize a database the deleted records actually get removed from the database file (which is slow).
So, merely deleting the records ought to be fast when in XnView. When quiting XnView, do the optimizing.

PS
Why did you change the cache routines? They were working really well before.

imforumman
Posts: 21
Joined: Wed Aug 23, 2006 2:03 pm

Re: RC2: Deleting files is extremely slow when cache is enab

Post by imforumman » Sun Jan 28, 2007 9:44 am

iycgtptyarvg wrote:When you have the cache setting on (to memorize the thumbnails for quicker browsing), the deletion of files is extremely slow.

To reproduce:
1. Have the 'Cache' option on.
2. Delete some (e.g., 10 pictures).

This didn't use to happen in v1.8x. This is so terrible that I'm currently forced to turn off this useful option.

PS
This can be reproduced on both RCs and also with the betas.
Just for the record: I can confirm this and have it very annoying as well.

User avatar
xnview
Author of XnView
Posts: 33620
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Post by xnview » Sun Jan 28, 2007 10:07 am

iycgtptyarvg wrote:
xnview wrote:But if you delete a file, i must update the db now, and not at the exit...
Ok, but deleting records from a database normally takes hardly any time; the records are only removed from the index (which is fast). Only when you optimize a database the deleted records actually get removed from the database file (which is slow).
So, merely deleting the records ought to be fast when in XnView. When quiting XnView, do the optimizing.
I don't optimize the cache on each delete...
Why did you change the cache routines? They were working really well
before.
No, not working well on a lot of files...
Could you send me a email to send a test version (exe can't be sent on gmail)
Pierre.

Post Reply