2
0
mirror of https://github.com/koreader/koreader synced 2024-10-31 21:20:20 +00:00
Commit Graph

9 Commits

Author SHA1 Message Date
NiLuJe
21b067792d Cache: Rewrite based on lua-lru
Ought to be faster than our naive array-based approach.
Especially for the glyph cache, which has a solid amount of elements,
and is mostly cache hits.
(There are few things worse for performance in Lua than
table.remove @ !tail and table.insert @ !tail, which this was full of :/).

DocCache: New module that's now an actual Cache instance instead of a
weird hack. Replaces "Cache" (the instance) as used across Document &
co.
Only Cache instance with on-disk persistence.

ImageCache: Update to new Cache.

GlyphCache: Update to new Cache.
Also, actually free glyph bbs on eviction.
2021-05-05 20:37:33 +02:00
NiLuJe
ce624be8b8 Cache: Fix a whole lot of things.
* Minor updates to the min & max cache sizes (16 & 64MB). Mostly to satisfy my power-of-two OCD.
  * Purge broken on-disk cache files
  * Optimize free RAM computations
  * Start dropping LRU items when running low on memory before pre-rendring (hinting) pages in non-reflowable documents.
  * Make serialize dump the most recently *displayed* page, as the actual MRU item is the most recently *hinted* page, not the current one.
  * Use more accurate item size estimations across the whole codebase.

TileCacheItem:

  * Drop lua-serialize in favor of Persist.

KoptInterface:

  * Drop lua-serialize in favor of Persist.
  * Make KOPTContext caching actually work by ensuring its hash is stable.
2021-05-05 20:37:33 +02:00
NiLuJe
d80d6dc562 Handle the BlitBuffer struct changes
* stride is now a size_t
  On some platforms, that's 64 bits, which means it's no longer
  automatically converted to a Lua number to avoid precision loss.
  Do that ourselves, because lua-serialize doesn't know how to handle an
  uint64_t cdata ;).
2020-12-19 01:54:43 +01:00
ezdiy
7a40b496fb
blitbuffer: fixups for base (#6714)
fixups for base bumped to https://github.com/koreader/koreader-base/pull/1201
otherwise tilecache breaks
2020-09-28 01:04:59 +02:00
Qingping Hou
f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 2017-01-02 19:52:09 -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
HW
09cd5c4104 Make DEBUG a require()d local 2013-10-22 20:51:29 +02:00
HW
ef111b99c6 Refactored to use strictly locals 2013-10-18 22:38:07 +02:00