2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
Commit Graph

17 Commits

Author SHA1 Message Date
Hans-Werner Hilse
6b45a4ea06 fix cache implementation
the cache would behave badly when the same item was insert()ed twice:
it would add the size twice to memory consumption, but would never substract
it twice when purging the (actually single) object from cache. So the cache
would seem to fill up while in fact it wasn't.
2014-11-12 15:21:20 +01:00
Hans-Werner Hilse
78b098e47d make functions in MD5 implementation local
also get rid of mostly unused helper libraries and some stylistic
oddities in the MD5 code
2014-11-11 15:53:26 +01:00
chrox
f48c073357 persistent cache item now need an explicit persistent flag 2014-10-30 11:16:37 +08:00
chrox
281df50da5 fix #1028 2014-10-23 13:49:35 +08:00
chrox
b7c7287bab remove more global variables 2014-08-14 19:52:30 +08:00
chrox
775e5ea3b4 serialize the most recently used blitbuffer/koptcontext
to speedup koreader startup for PDF/DJVU documents
especially when reflowing
2014-04-30 23:24:47 +08:00
chrox
92219a1f1e cleanup: expand tab to 4 spaces 2014-03-13 21:52:43 +08:00
chrox
904a5f1ebe calculate maximum global cache size from free RAM
In reflowing scroll mode with 2 pages hinting, 4 full page blitbuffers
and koptcontexts should stay well in cache in the most demanding cases,
with two pages shown on screen and two pages rendered in background.
Since blitbuffer size is halved the size of page, we need cache size
to be 6 times an average reflowed page size.

For Kobo Aura HD which has a resolution of 1440×1080, a reflowed page
could become 1080×4800. So 30MB of cache is demanded for this case.

This PR implements dynamic cache size allocating according to size of
system free memory. By default it will use 20 percent of free RAM with
a clip specified by DGLOBAL_CACHE_SIZE_MINIMUM and
DGLOBAL_CACHE_SIZE_MAXIMUM which are 10MB and 30MB respectively by default.
2014-01-19 11:40:34 +08:00
HW
ef111b99c6 Refactored to use strictly locals 2013-10-18 22:38:07 +02:00
Qingping Hou
561c7902ca move defaults.lua to root directory 2013-07-01 02:55:28 -04:00
Qingping Hou
18122fe067 add defaults.lua 2013-07-01 02:41:33 -04:00
chrox
4e1572d7d0 change cache size to 10 MB 2013-04-30 13:45:14 +08:00
chrox
8f18ee260c increase max size of cache item 2013-04-20 16:10:46 +08:00
chrox
4fda0611c2 remove unnecessary require 2013-03-26 13:21:29 +08:00
chrox
01f045e7f9 add standalone glyph cache
I found it will be especially helpful to cache glyph separately
so that glyph caches won't be washed out by a single page cache.
2013-03-25 16:26:57 +08:00
Qingping Hou
687aabc173 adapt ui to loadDocument before setFont 2013-01-13 10:22:33 +08:00
HW
9e531fc2db file reorganisation
all lua frontend files are now in the frontend/ directory.
all old code is cleaned up.
2012-05-19 01:10:57 +02:00