Page 1 of 1
RC2: Deleting files is extremely slow when cache is enabled
Posted: Wed Jan 24, 2007 4:13 pm
by iycgtptyarvg
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.
Re: RC2: Deleting files is extremely slow when cache is enab
Posted: Wed Jan 24, 2007 8:11 pm
by xnview
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?
Posted: Thu Jan 25, 2007 9:49 am
by iycgtptyarvg
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.
Posted: Thu Jan 25, 2007 11:05 am
by xnview
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...
Posted: Fri Jan 26, 2007 2:31 pm
by iycgtptyarvg
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.
Posted: Fri Jan 26, 2007 2:32 pm
by xnview
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...
Posted: Sun Jan 28, 2007 8:23 am
by iycgtptyarvg
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.
Re: RC2: Deleting files is extremely slow when cache is enab
Posted: Sun Jan 28, 2007 9:44 am
by imforumman
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.
Posted: Sun Jan 28, 2007 10:07 am
by xnview
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)