06-06-2016, 03:28 AM | #1 |
Unicycle Daredevil
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
One file per chapter vs. many chapters per file?
Prompted by a bug in the current Kobo firmware, in which the TOC only works properly when each chapter has its own file, I have been forced to rethink my approach to this problem.
After experiences with a few bought books with hundreds of individual files that were very slow and worked much better after I had merged a lot of those files, I had come to the conclusion that it was better to have fewer files with several chapters in them. However, in the books I recently made I used an individual file for each chapter, ending up with many hundreds of files (poetry collections!) and the books work just fine, perhaps even a bit snappier than with fewer, larger files. So what slows a book down? Is it many links inside files? Between files? What's your experience? (Obviously, even if many small files should turn out to be the better solution, Kobo still must fix that bug. Sometimes you just need the option to have a chapter break without a page break, and that's just not possible if you have each chapter in its own file.) |
06-06-2016, 03:38 AM | #2 |
Curmudgeon
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
|
I would expect that a larger number of smaller files would perform much better. The amount of memory and CPU power needed to keep track of the metadata for a few hundred files is negligible. The amount of RAM and CPU overhead involved in rendering a large DOM tree is huge. So the smaller the HTML files are, the better I would expect the book to perform, assuming all else is equal.
If that isn't the case with some particular reader, I'd be curious why. It probably involves somebody accidentally implementing bubble sort or something equally atrocious. :-) |
06-06-2016, 10:04 AM | #3 |
A Hairy Wizard
Posts: 3,094
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
^^ +1
Plus, it's just easier to organize/edit your book if you have different files for different purposes... Cover, title, dedication, epigraphs, chapters, glossary, etc. |
06-06-2016, 10:46 AM | #4 |
Well trained by Cats
Posts: 29,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
many files also leaves memory for big images (and multi media)
Both Calibre and Sigil editors (those are just the ones I use) have search options that work over many files Small files under the knife, the less chance of a BIG |
06-06-2016, 11:50 AM | #5 |
Unicycle Daredevil
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
Thanks for your replies.
So it really seems small files are better. I wonder what was wrong with those books that put me off the idea. Perhaps Sigil silently fixed something when I merged their files and that's why they were better after. I'll see if I can remember what those books were... |
06-06-2016, 12:05 PM | #6 |
frumious Bandersnatch
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
Small files also make it easier to have a consistent chapter break formatting. If you have several chapters in the same file, breaks within the file may end up being rendered differently from breaks from file to file. If you can keep full "groups" within each file (like parts of a book, or books of a trilogy), it may not matter but then you are also more likely to hit some memory limit in some reader, and be forced to break the file at unnatural places anyway.
|
06-20-2016, 08:50 AM | #7 |
Hmm.
Posts: 124
Karma: 2016606
Join Date: Oct 2015
Device: Android 4.2 Google Play Reader
|
One file per chapter is better because on the older ereaders each chapter can only be 300kb long. Plus on the Moon Reader, at the beginning of a file/chapter, the text begins on a new "screen/page".
|
06-20-2016, 09:29 AM | #8 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
|
06-20-2016, 10:13 AM | #9 | |
Unicycle Daredevil
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
Quote:
Regarding the new file starting on a new page: Sometimes there are chapters you don't want to start on a new page. That is why more than one chapter per file must always remain an option. |
|
06-30-2016, 10:40 AM | #10 |
Resident Curmudgeon
Posts: 73,974
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
It's not a chapter if it doesn't start on a new page. What you are talking abut are sections.
|
06-30-2016, 11:07 AM | #11 |
Unicycle Daredevil
Posts: 13,923
Karma: 185041098
Join Date: Jan 2011
Location: Planet of the Pudding Brains
Device: Aura HD (R.I.P. After six years the USB socket died.) tolino shine 3
|
|
06-30-2016, 02:23 PM | #12 | |
Wizard
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
|
Quote:
I have seen bookari get muddled also when there is not one file/chapter per toc entry. I think it was robin Hobbs ship of fools where she had nested headers , for chapters within sections, and bookari toc assigned page numbers that were off by one chapter. An edit to flatten the toc fixed it. |
|
06-30-2016, 05:34 PM | #13 | |
Resident Curmudgeon
Posts: 73,974
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
NONE of those are chapters. But by your incorrect assertion, they are chapters. I have seen plenty of books where subsections get a ToC entry but are not chapters. A chapter starts it's own page and if size permits, should be all in one file. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Create a new file/chapter | John Leftwich | Editor | 4 | 11-13-2015 07:53 AM |
Chapter markers in text file? | Strahan | Amazon Kindle | 4 | 01-09-2014 01:06 AM |
reorgainse epub into 1 file per chapter | cybmole | Calibre | 3 | 01-15-2011 07:24 AM |
No Chapters in my epub file | carolehughes | Kobo Reader | 4 | 10-29-2010 02:51 AM |
Remove File Name in front of Chapters | tochill | Calibre | 6 | 03-04-2010 07:34 PM |