View Single Post
Old 06-28-2024, 11:45 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,400
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibredb is fairly slow to startup mostly because of python interpreter startup lag. In addition it has to open and parse metadata.db on every invocation. You can get an idea of the breakup of times for these two tasks by contrasting the time taken for

calibredb --help
vs
calibredb list --limit=1

The latter of the two can be reduced by having calibredb connect to a running calibre-server instance. Or you can just use one of the JSON endpoint of the calibre server directly, which should be basically instantaneous. This does require keeping calibre running in the background. If you dont want to do that, you can just query metadata.db yourself using some sqlite tool. Getting a list of titles from it is pretty trivial, it involves simply reading the title column from the books table.
kovidgoyal is offline   Reply With Quote