Thread: EPUB output
View Single Post
Old 05-29-2009, 04:18 PM   #517
=X=
Wizard
=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.=X= ought to be getting tired of karma fortunes by now.
 
=X='s Avatar
 
Posts: 3,672
Karma: 12205348
Join Date: Mar 2008
Device: Galaxy S, Nook w/CM7
Submitting Request to remove "#HREF" tag from TOC top level menu

TOC with "#HREF" syntax makes opening the ePUB extremely slow. With large enough TOC files this will take a long time or even cause the reader to crash.

Request: Can calibre stop inserting the "#HREF" tag for the top level capters or add a switch to disable the #HREF for the top level chapters from the TOC.NCX file.

PROBLEM:
I've noticed a big performance hit every time I try to open up an ePUB book and use the TOC. You mentioned on a different thread it was due to the #HERF.

TEST:
Okay I've done a few test to see how true this is and if there is a good solution to resolve this.

Attached is 3 files
Test File.epub (unmodified calibre generated TOC)
Test File_NOREF.epub (ALL #HREF removed from all URL in the toc.ncx file)
Test File_noREF_Capter.epub (Only the top level chapters have the #HREF removed, sub chapters have the #HREF)

Measured time to the TOC from an ePUB book created from calibre.
  • Test File.epub
    : 110 sec (1min 50 sec)
  • Test File_NOREF.epub
    (Instant)
  • Test File_noREF_Capter.epub
    : Instant for top level chapters. Sub chapters varied depending on how many sub elements it had. The last chapter had 40 items and took 1.5 sec

I also ran the same test on Jeff Carver's ePUB book from Fictionwise. The default book took 8sec to load.
When I removed the #HREF from the toc.ncx file the load time was instant.

Note: I did not test 3 level TOC items.

SOLUTION
There is a HUGE performance increase by just removing the the #HREF URL path from top level TOC. While there still is a hit on sub toc they are small and tolerable.

=X=
Attached Files
File Type: epub Test File.epub (30.5 KB, 172 views)
File Type: epub Test File_NOREF.epub (30.2 KB, 166 views)
File Type: epub Test File_noREF_Capter.epub (30.4 KB, 163 views)
=X= is offline   Reply With Quote