-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimization of page turn command and picking of the last commits of the koreader. #156
Conversation
…d due to the optional excluding of the element search loop in LVDocView::getPageDocumentRange() and LVDocView::getBookmark(). The execution time for this command has been significantly reduced, before this fix, in some cases it reached 6 seconds, now it does not exceed 100 ms on the same device.
Requires libunibreak patch that adds lb_get_char_class().
Fix possible crash with previous commit where we could add 2 more slots in the statically sized array _lb_props[10]. Use 20 to be safe.
@poire-z I guess the commit 7737527 won't break anything in the koreader. |
(sorry for the delay in responding...)
It won't break anything, as we won't provide precise=false. That slowness happens only in scroll mode ? And not at all in page mode? About the textlang patch, was there really a need for KO_LIBUNIBREAK_PATCH (and that little divergence introduced) ? (btw, you forgot it in textlang.h, althought it wouldn't cause any issue as long as it's not called). |
Called with argument 'false' only in DocView.getPositionProps() which is used only for page turn, text scroll, show TOC dialog, show book info, update current position status. It may also be necessary to add this argument 'precise' for functions higher up in the call stack, so that getBookmark() and getPageDocumentRange() was called with the 'precise' argument 'false' only when turning pages and text scrolling. coolreader/android/jni/docview.cpp Lines 1696 to 1711 in 249a068
So I hope it's not affected to CoolReader.
We should check then. How can I do? Can you upload specific file for testing?
Mostly, before: ScrollViewAnimation preparation 3739ms, after: 63ms. But page mode also affected: before: PageViewAnimation preparation 125 ms, after 63 ms.
I don't see any other solution until this patch is included in the libunibreak upstream: desktop build of CoolReader use system library libunibreak, and without this patch we will get a compilation error. Those we will be forced to stop using the library installed on the system.
I don't think there was anything to be added there. I add corresponding option into Android project file: coolreader/android/app/CMakeLists.txt Line 36 in 249a068
|
Oh, ok, I didn't know that. Allright then.
Oh, allright again, these are not defined in textlang.h. I got confused :)
I think I triggered that bit of code with the Petra.AR as mentionned at #125 (comment) - when a float is split on 2 pages. I think I might have tweaked the CSS (all float: & clear: left), so here is one where the chapter 7 looks the same: Petra2.AR.zip (you might want to change font size if the cut does not happen because text and float would luckily just align). Also may be when there is some margin-top on some element at top (like chapter title, bordered images in Wikipedia EPUBs when the border is at top of page), but may be only in legacy rendering mode (as we may drop that top margin in enhanced rendering).
But then, why are you calling these functions if you are fine with them returing NULL ? :) May be you just donc care about the return values, and these calls could be avoided in these context. Quick look at your first commit about getPositionPropsInternal():
|
Thanks, I will test how the time will be.
I didn't write it. I can't even guess where this will lead :)
May be it's a good idea. |
See https://4pda.ru/forum/index.php?showtopic=191747&view=findpost&p=99147082
Based on Merged with KOReader fork of crengine #125 (comment)