← Back to team overview

calibre-devs team mailing list archive

Startup time questions

 

My catalog is about 30,000 records, and when I start Calibre, I spend about
five minutes looking at the splash screen. So I ran it through cProfile, and
a couple of things stand out.

The biggest item is over three minutes on DatabaseLibrary2.has_cover(). I
tried replacing os.access() with os.path.exists(), but it only shaves off 15
seconds. Now I'm wondering, exactly what are the ramifications of removing
the call from DatabaseLibrary2.get_data_as_dict()? It looks like the actual
cover display does its own check anyway.

The second item looks like SQLite performance related to the sortconcat()
aggregate. Is the sortconcat() the only reason meta2 is not a persistent
view? When I create a persistent view using a derived table* instead of
sortconcat(), it shaves off about 30 seconds of load time.


*(SELECT group_concat(name) FROM (
    SELECT name FROM books_authors_link AS link INNER JOIN
    authors ON(link.author=authors.id) WHERE link.book=books.id
    ORDER BY name ASC)
    names)
authors

Follow ups