I quickly looked at the code. It seems to me the most time-consuming part is at the end of "
doLoadBookFromDirectory" when each page of the book is preloaded. We could potentially speed it up by loading each page only the first time it is used.The only thing that might get in the way is maybe calls to "touchAllSubsequentPages" which are made at each insertion of deletion (and would force all subsequent pages to be loaded) although I cannot see why this function call is needed. Volker can you explain why this is necessary? It seems like all pages are touched when they are loaded as well, and I can't figure out why.
As far as I can see, the only other functions that might have to load all pages of a book would be the updateFilteredPages and export functions. For filters, the best is probably to store a separate filter index for faster loading...