-
Notifications
You must be signed in to change notification settings - Fork 95
crengine page mode is slow on opening some epubs #700
Comments
Could you help me test it in scroll mode also? I want to make sure it's just page mode slows it down. By editing Thanks a lot. |
Regarding the second bug, you are right, I have added the fix in RP |
@houqp , I changed the mode to scroll mode after I opened that epub, so I can open it without editing default.lua. I found with newly started kpv (it seemed kpv cannot really use the cache after a new session), it took a long time to open that epub even in scroll mode. My estimate is:
Can you also have a look at the cache? If it works between sessions, the problem will be much smaller. I put my epub here |
@kai771 , I tried Librerator with that epub.
Librerator looks good to me, though there are lots of changes and I'll need to move all my history files to start to use Librerator. I'm wondering if it's easy for you to incorporate new developed features in kpv to Librerator? Because I may want to use Librerator, but I also would like to see new features in kpv go to Librerator too. |
@dracodoc the toc problem is fixed in KPV too, but not yet committed to the master tree. Concerning the fonts problem --- it is possible that you simply named it incorrectly in the KPV's "fonts" directory but correctly in Librerator's "fonts" directory. Please check that the filenames are exactly identical. The goto page was fixed in KPV too, it is already committed into master, but no nightly build was generated yet. |
It's not the problem of file name. When I first reported the problem in mobileread thread, I was comparing two font settings both in KPV. You can try this:
And now I found Librerator is same in this. Maybe I mistaken other settings in Librerator. Besides, which fonts is responsible for the pdf table of contents fonts in KPV? It seemed that rifont only work for the reading position, not for the table of contents. The table of contents will use the same fonts of cfont, which can only be selected from kindle host fonts rightnow. |
@dracodoc As far as I know, there are no features present in KPV that are not present in Librerator. Some things are done differently, but I tried to make it as configurable as possible. (for example, I prefer old style of "bookmark added" dialog, so that one is the default. But you can have your style if you set DKPV_STYLE_BOOKMARKS to true in defaults.lua. |
Yes I noticed that. The first thing I did is to change the bookmark style to KPV style, since that was actually "my style" :PP. I also copied the history files and began to use Librerator. What I worried is if there are lots of difference between KPV and Librerator, it could very cumbersome to introduce new features into Librerator, and there is only you to do all the work. |
@dracodoc Well, yeah, there are a lot of differences... and there will be much more when KPV releases touch support. Of course, there are no guarantees that I won't abandon it tomorrow... but it's open source, so... Btw, have you tried screen rotation yet? ;) |
What screen rotation? I noticed there are some changes in the screen rotation key but I didn't try it. |
You can now rotate to landscape and back to portrait using the same key :). Try it. Both J and K work. And if you're interested, do have a look at History on wiki. It is a bit long, but you might find it interesting. |
thanks @dracodoc , good to know that it's not page mode that slows everything down. I will take a look at it tonight and also the cache problem. |
Yeah I skimmed through the history in wiki but didn't really notice the same key rotation. It's great, I like that, because I usually will always use one direction to rotate, so using one key to handle all rotations is good for me. I don't even remember if I suggested this by myself some time ago. |
@dracodoc Yeah, you did... I implemented it specially for you :P. |
Thanks, I'm honored... This long discussion actually covered several problems, I'll list them here, maybe submit them separately after a while if they need more time to working on:
|
OK, I just did a quick check on font setting. I cannot reproduce it in my DXG, So far I cannot think of a reason why it does not work for you. Very likely this can be fixed by wipe out and re-install KPV from scratch. Or if you really want to help us fix that bug, please pack your whole KPV folder and put the link here. |
I found the deeper cause of the problem:
Since this happen to all host fonts, it is not the problem of my Chinese font. I changed the entry in settings.lua back to droid fonts, then it can read all the fonts again. So the font setting will fall into some trap once it was set to host fonts. One simple solution is just ignore host fonts all together, user can always copy the font they want to fonts folder, even if they want to use some host fonts they can just copy them. |
@dracodoc , you should go to bed at this time ;p Nice found, but I still cannot reproduce it. Following is what I did:
I can still see all the fonts in the font list, did I missed anything? EDIT: I am going out now, will check back tonight. |
I'm in U.S. now so it was noon for me :) First, did you have fonthack? I installed fonthack to show Chinese file name, but I only changed one font to Chinese font. I tested again, at least host/serif_bold, host/serif_Regular, host/Mono_Regular all have this effect.(I expect more have same result, but every attempt will trap one font into host mode so I didn't try all fonts). You don't even need quit kpv or quit font settings, just quit to the font setting screen then back to the font selection, you will see the effect. Since I only changed Serif_bold, the other fonts are original kindle fonts, I don't think it's the problem of my fonts. I've been wondering about the empty "host" folder in fonts folder for a long time, I'm guessing that was for a symbolic link to fonthack host folder, once some fonts there was chose, the path of fonts have been changed so the font selection can only see host fonts. The simple solution is just remove host folder and that link to avoid this trap. |
@dracodoc host folder is where KPV mount binds system fonts on start, and unmounts them on exit. That's why it's empty if KPV is not running. If they're not mounted there, KPV would not be able to see system fonts, I think. In that case you would have to copy fonts to fonts folder in order for KPV to find them. I'm not using fonthack, so I don't know what changes it does to the system. |
If the font setting problem is not obvious to solve, I think it's ok to leave it as is. It should only affect fonthack user, and once user know the trap he can avoid using host fonts. If he already selected some host fonts, it can be modified in settings.lua. And the problem about pdf table of content font also can be avoided. The major problem now is the slow opening of epub, and the cache problem. I think the cache problem is more important and easier to track. |
@dracodoc I'm thinking that maybe hyphenation might be one of the reasons why opening is slower (no evidence, just an idea). |
OK, I tested with stopwatch again. So maybe the cache is working, but why the same session opening is much faster? something still in RAM? I don't know why your k3 need 35 seconds to open it. Another difference in my settings: |
@dracodoc Now, this is the good part: My previous measurments were done with Librerator - although I thought I didn't change anything about the cashing and stuff, I might've accidentally done something. Will be interesting to find out what, but will have to wait at least until tomorrow. One other thing, might be helpful: in Cool Reader 3, if we open your epub for the first time, it takes around 30 sec. If we close it and start Cool Reader 3 again (it opens the last file by default), it again takes some time to show the page (I didn't exactly time this, but let's say it's about 25 sec). After Cool Reader is up and running, switching between epubs is much faster. Maybe there's some initialization for crengine that we're failing to do, that Cool Reader 3 does on startup? Just a thought. Oh, and emulator exhibits similar behaviour - first opening of epub, on freshly started Emu session, is noticeably slower than subsequent ones. |
Yes I forgot the part of open other epub can "warm up" crengine and make the opening big epub much quicker, I found this behavior before and thought maybe crengine need some time to be loaded into RAM, since at that time the opening time was always less than 1 min, I didn't think there is a problem. |
Aha, I found out the culprit ;p It turns out that most of the time is wasted on loading fonts. Currently, we open a document without setting default font, so crengine will choose one for us, most of the time, it's not what we want. Then latter we read the document config and update the font. Now we load font two times and the first time is useless. Crengine warm up is also related to font loading. Every time we exit KPV and open again, all the fonts have to be reloaded again. Here is my test result with the new patch:
We can make it a little bit more faster because I see from the log that crengine is still choosing font for us in one or two places. But I think this is good enough? Here is the download link for the patched KPV I am using (it also includes all the other bug fixes): |
@houqp , this is great news! Now the performance is very good! I'll try the patched version now. I tried it, it took about 1 min (I didn't measue with stopwatch) to open that epub without cache, and about 6 seconds with cache but no warm up. It's very good. One problem is, when I navigated to some place in page mode, if I switch to scroll mode it will jump to the beginning of the book instead of the same place of page mode. And if I was in scroll mode it will jump to the end of book if I switch to page mode. Though if I switch back to the original mode it will remember the location of that mode. So right now the two mode are using 2 set of histories. |
Got it. I will fix that bug tonight. BTW, why your DXG is a lot slower than mine? Did you have other hack running at the same time? |
I tested again with stopwatch, it's 27 seconds, so my first estimation is way off :PP Another question, does crengine have to hyphenate? I found Chinese epub with english text will have bad effect with crengine, for example, English text inside parentheses would break early and left a very short line, probably because it cannot recognize English, Chinese and parentheses properly to hyphenate correctly. OK, I found that I can modify epub.css to remove hyphenate. The Chinese epub is better now, though there is still some time the English text inside parentheses is broken into 2 lines, maybe I need to adjust justify too, but that could harm English epub display. I think there should be 2 different css for Chinese and English epub. Maybe I can use the cr3 extension and modify the css, make all Chinese epub to cr3 extension and use that css. On second thought, a better method will be enable loading customized css within a book. So user can prepare several different css and put them inside data folder, open a book, press a key to load with certain css. This will solve these problems: Another question, I like the page mode display but can we hide the title bar in page mode?Since the kpv convention is always full screen and show status by press menu key, I'd like to have the page mode in full screen and show title bar only when user press menu key or other key. |
wow, so many stuffs added to TODO list ;p I created #710, #711 and #712 to keep track of the feature requests. All of them will be possible. But for the full screen page mode, you might only want to see the native KPV status bar because toggling full screen mode is actually re-typsetting the document and thus is time consuming. Since we are waiting for the Jan release now, I would prefer to freeze the code for bug fixes only and add these features after the release. It will take a couple of days. |
closing for now since patch is merged to master. |
If the font setting problem will not be solved (since it only affect fonthack user and not many people reported this problem), I'll note this problem in the wiki to tell people who did meet this problem how to avoid it. It's here |
Thanks for the tip :) |
I found the newest build v2012.11-45-ge183bce is very slow on opening a medium size epub, which is only 1.6M, converted from mobi, "Structure and Interpretation of Computer".
The previous version take about 1 min to open the book, then it will open the book in several seconds as long as kpv is not closed then launch again -- I'm not sure the crengine cache still works after kpv launch again, it works in same session.
However with the current version, it took about 3 mins to open the same book. I believe it's related to the page view mode, and I cannot switch the mode before opening any epub file.
Besides, the go to position doesn't work in page mode too, I input 1 percent but it jump to the end of book, and it say current position is 1 for the end of book. I guess the go to position dialog is still in scroll mode.
The text was updated successfully, but these errors were encountered: