bell notificationshomepageloginedit profileclubsdmBox

10% popularity   0 Reactions

You cannot optimize and make it faster to load and to be processed from the reader in a generic way for all possible readers and probably not for all available readers¹.

The reason is that there are conflicting elements involved that lead to different loading results on different device hardware configurations. For the reading device these configurations include:

CPU speed
availability of CPU cache(s) and its size
work memory speed (access time, width of access path)
storage memory speed if EPUB stored internal
SD card interface speed and SD card read speed if the EPUB is stored externally

From the above the SD card speed is most obviously variable, as SD cards are sold in different classes.

Assuming there is no DMA involved all of the EPUB data has to go through the CPU. Uncompressing data from an EPUB (ie. ZIP

If the storage is slow and CPU speed high, you better compress the data in an EPUB (use zip DEFLATE). If storage is fast and CPU speed low than you better not compress the data in an EPUB (use zip STORE). Decompressing compressed data from an EPUB file is non-trivial, including bit manipulations and tables. Implementing a decoding library for DEFLATE—although to a lesser extend then encoding—involves trade-offs between speed and memory requirements.

So just deciding² whether you should compress the data in an EPUB file or not—in order to make them faster to load is a hard to answer in general, although you should be able to do so for a specific reader after some testing.

¹ In this example I only approach the compression vs non-compression issue to make a point. Other elements that at first glance don't seem to have a global optimal solution: 1) Size of images so they don't require rescaling on any device and have maximum detail. 2) Use the deflate algorithm on JPEG images to get a little bit of extra compression for a double decompression to pixel information. 3) EPUB2 vs. EPUB3 issues. E.g. EPUB3 forces use of CSS for things like font size (as <font> is not supported in HTML5). However an EPUB2 device might render <font> faster than something specified in a separate CSS file, especially if applied only once in the HTML file.

² The resulting difference of any particular trade-off might be minuscule compared to other things that influence loading speed. That is of course irrelevant: every tiny bit helps, some just more than others.


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

Login to follow story

More posts by @Lorraine

0 Comments

Sorted by latest first Latest Oldest Best

 

Back to top