Quote:
Originally Posted by chaley
The template {formats} is evaluated in several steps.
1) When {formats} is referenced for a book, check if it has been resolved and cached for that book. If so, return that value.
2) If the formats for a book have not been resolved, then verify the formats for the book. For each format:
- Check if that format has been resolved in the past. If so, use those values. This cache can be cleared if the content server is running and determines that its view of the database is out of date.
- If the format has not been resolved, do a "stat()" on the format file. Cache the path, the size, and the modtime of the format. Return these values. Return an empty record if the format does not exist.
3) If {formats} is never referenced, never do either step 1 or step 2.
The effects of the caches make getting consistent results from timing tests rather problematic. For example, sorting on {formats} will fill both caches. From that time forward, there will be no disk access. Which cache is used depends on the test.
The "treacle" test should be done in a way that ensures that the caches have not been filled. Something like:
- Ensure that the {formats} column is not in the startup sort set.
- Start calibre.
- Scroll down.
My guess is that calibre will be noticeably slower scrolling when there is a {formats} column. It must do a stat on each format for the book before it can display the book line. The approximate_formats() function avoids this work.
|
@
chaley - do the caches persist across calibre starts, and do they persist across reboots ?
Yesterday I put { formats }
back into my Default View (View Manager), it may have slowed my calibre start from 1-2 secs to 3-4 secs - but IMO thats just almost within the normal margin of variability - and plenty good enough for moi.
And I am still getting smooth scrolling and fast sorts on that column, even after several restarts of calibre, system shutdowns and cold boots etc
It's very odd - it's not just calibre that's working faster, so are my music and image library programs - quodlibet and iMatch. Even firefox feels snappier. This morning my fixed line phone wasn't working, called the telco, couple of hours later there was a man in the street fixing it!
BR