View Single Post
Old 04-29-2015, 03:28 PM   #943
chrisridd
Guru
chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.chrisridd ought to be getting tired of karma fortunes by now.
 
chrisridd's Avatar
 
Posts: 983
Karma: 2209358
Join Date: Nov 2011
Location: London, UK
Device: Kobo Aura, Kobo Aura ONE, PocketBook InkPad Color 3
I watched calibre 2.26 opening/closing files via a short dtrace script - and noticed some quite strange behaviour. (I wrote the script in case one of David's driver updates has issues again.)

Essentially, every book cover in the library seems to get opened twice (and then closed, so no fd leaks.) Do you know why that might be? It doesn't seem very efficient to keep hitting the filesystem.

Calibre also seems to read the covers (again, double opens and closes) of a number of other books every time you select a book in the main list. It feels like it might be filling a sort of cache (read-ahead), but then when you select one of the other books that got opened, calibre goes and reopens the cover (twice) anyway. Odd.

Here's a bit of the output of my script to show you what I mean about the double opens/closes:

Quote:
open /Users/cjr/Calibre Library/Alastair Reynolds/Revelation Space (210)/cover.jpg succeeded: fd 36
open /Users/cjr/Calibre Library/Alastair Reynolds/Revelation Space (210)/cover.jpg succeeded: fd 37
close /Users/cjr/Calibre Library/Alastair Reynolds/Revelation Space (210)/cover.jpg fd 36
close /Users/cjr/Calibre Library/Alastair Reynolds/Revelation Space (210)/cover.jpg fd 37
open /Users/cjr/Calibre Library/Arkady Strugatsky/Roadside Picnic (133)/cover.jpg succeeded: fd 36
open /Users/cjr/Calibre Library/Arkady Strugatsky/Roadside Picnic (133)/cover.jpg succeeded: fd 37
close /Users/cjr/Calibre Library/Arkady Strugatsky/Roadside Picnic (133)/cover.jpg fd 36
close /Users/cjr/Calibre Library/Arkady Strugatsky/Roadside Picnic (133)/cover.jpg fd 37
chrisridd is offline