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.
|