Removing a book takes mnts

Bug #1205889 reported by Jerome LAURET
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Invalid
Undecided
Unassigned

Bug Description

Background information
- Calibre 0.9.00 but noticed it a while back with previous versions
- Calibre running on Windows 7
- Typically, I always have all books in EPUB and MOBI (at minimum)
- I have ~152 books in my library

Whenever I attempt to remove a book from the library ("Del" or right click -> Remove books -> Remove selected books) it literally takes a minute (or even more) for the book to be removed. This is very inconvenient when I want to clean the library of downloaded news feeds (the mn or more wait is PER book).

Assuming a corruption of some kind, I tried un-installing Calibre and re-installing it (making sure no directories are left behind), imported all my books back and the same behavior is seen (very long time to delete an entry / a book). Is this expected or ...?

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1205889

I cannot reproduce this behavior, deleting books takes under one second
non my library with ~500 books. Things you can try:

1) EMpty your recycle bin
2) Exclude the calirbe library folder from your antivirus program's
scans

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
Jerome LAURET (jlauret7) wrote :

Namaste Kovid,

Thanks for your suggestions - however, already tried:
- empty recycle bin - no effects (also tried cleaning TEMP and other areas using CCleaner and similar)
- disable anti-virus program - no effect (my test removal of a book took 42 seconds just before posting this follow-up)

Not sure what else to do & try.

I have to state that I had noticed a similar behavior with another application but after upgrading to the "Windows 7 & 8 compatible" upgrade, the problem was gone (the previous version was an XP approved). Makes me suspicious of a possible different ways (calls) to delete files? At present, only Calibre and a program named "DeleteXP" (I am sure not a coincidence) have this behavior. Does this observation help?

Revision history for this message
Kovid Goyal (kovid) wrote :

Not really, calibre uses the standard windows API call ShFileOperation
to delete files to the recycle bin. I'd guess that something on your
computer is making your recycle bin slow, you can try disableing it (of
course this makes all dete operation permanent) as described here:
http://windows.microsoft.com/en-in/windows-vista/change-the-recycle-bin-settings

Revision history for this message
Jerome LAURET (jlauret7) wrote :

I also tried to create a brand new account "Test" and use a 2 books library (the default start guide + one book) then delete the book I added. This was a 38 seconds long deletion. Note that in the case of creating a new account, the idea was that the "Recycle bin" would not be the same AND I tested at the same time one of Windows infamous problems: possible corruption of the user profile having odd side effects. Since Calibre book deletion behaved the same under a brand new account, both speculations are invalidated. Since the new account also had 2 books, I somewhat tested another thought of mine (record removal on a large db and possible problems with large number of files - this is not the reason as independent of the number of books).

I tried what you suggested and set the Recycle Bin to remove immediately and still - 43 seconds for one book deletion.

OK, I will try a few more things and report - two tests coming to mind
- sure way to test if the issue is with a third party component is to boot in safe mode and try again
- well, last hope is to trace all actions performed by Calibre when a deletion is requested

Revision history for this message
Jerome LAURET (jlauret7) wrote :

Also

;SHFileOperation function
;12 out of 23 rated this helpful - Rate this topic
;
;Copies, moves, renames, or deletes a file system object.
;This function has been replaced in Windows Vista by IFileOperation.

Pondering ... I know this may be a Windows compatibility choice (since IFileOperation is from Vista onward) but I have seen (now that I am digging), others reporting this problem. Also, some suggested

fileStruct.fFlags = FOF_FILESONLY; // instead of FOF_ALLOWUNDO, not sure if you use this in your code

like in http://stackoverflow.com/questions/4568015/using-shfileoperation-what-errors-are-occuring

won't be able to test this myself though.

Revision history for this message
Kovid Goyal (kovid) wrote :

FOF_FILES and FOF_UNDO are orthogonal, they have nothing to do with each
other.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb759795.aspx

And calibre has to work on Windows XP. Something *local to your
computer* is slowing down SHFileOperation, the solution does not lie in
changing calibre code, it is in finding and fixing whatever that is.

Revision history for this message
Jerome LAURET (jlauret7) wrote :

I would like to comment that after trying to ask for help in the Windows 7 forum ( http://www.sevenforums.com/general-discussion/299724-slow-deletion-files.html ) and getting no special good advices, I was about to give up on Calibre but ... updating to release 1.0 from yesterday, the problem of slow deletion of added books is now gone.

No previous version update from the 0.9.x series did anything and my base test program forthe Windows 7 forum (using the SHFileOperation() for file deletion) is still slow indicating the improvement has nothing to do with any Windows updates but with Calibre itself. Whatever was done (could also be related to the new DB backend), I thank you ... it is usable again.

Bahut dhanyavaad

Revision history for this message
Kovid Goyal (kovid) wrote :

The new backend does the move to recycle bin asynchronously, in a
separate thread.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.