Skip to content

Stream inflated EPUB HTMLs down to disk instead of inflating in memory#4

Merged
daveallie merged 2 commits intomasterfrom
feature/zip-stream
Dec 7, 2025
Merged

Stream inflated EPUB HTMLs down to disk instead of inflating in memory#4
daveallie merged 2 commits intomasterfrom
feature/zip-stream

Conversation

@daveallie
Copy link
Member

@daveallie daveallie commented Dec 7, 2025

  • Stream HTML from ZIP down to disk
    • This only affect actual chapter content, the TOC etc are still read straight into the memory, which can take 2-3x the size of the file, but we'd need to allocate at least 38kB for the dictionary buffers to do it progressively anyway, so for those small files, this way is actually likely lighter
    • Could add a check for this in the future and pick streaming or one shot based on size
    • We still use the tmp HTML file to avoid parsing the XML while the inflation bits are in memory
  • Downgrade miniz for stability
    • Had a lot of issues with using tinfl_decompress in version 3, it seems like there are memory boundary issues in it, but I have no idea, downgrading to 2.x has fixed them

This should hopefully address some of the load issues in #3

@daveallie daveallie merged commit de453fe into master Dec 7, 2025
@daveallie daveallie deleted the feature/zip-stream branch December 7, 2025 13:39
@daveallie daveallie mentioned this pull request Dec 7, 2025
martinbrook pushed a commit to martinbrook/crosspoint-reader that referenced this pull request Jan 30, 2026
Address review comment crosspoint-reader#4:
- Replace hand-rolled pixel rendering logic in renderFromCache() with
  shared drawPixelWithRenderMode() from DitherUtils.h
- This also hoists getRenderMode() out of the per-pixel call since
  drawPixelWithRenderMode handles it internally
martinbrook added a commit to martinbrook/crosspoint-reader that referenced this pull request Jan 30, 2026
Address review comment crosspoint-reader#4:
- Replace hand-rolled pixel rendering logic in renderFromCache() with
  shared drawPixelWithRenderMode() from DitherUtils.h
- This also hoists getRenderMode() out of the per-pixel call since
  drawPixelWithRenderMode handles it internally
martinbrook added a commit to martinbrook/crosspoint-reader that referenced this pull request Feb 1, 2026
Address review comment crosspoint-reader#4:
- Replace hand-rolled pixel rendering logic in renderFromCache() with
  shared drawPixelWithRenderMode() from DitherUtils.h
- This also hoists getRenderMode() out of the per-pixel call since
  drawPixelWithRenderMode handles it internally
lukestein pushed a commit that referenced this pull request Feb 3, 2026
Address review comment #4:
- Replace hand-rolled pixel rendering logic in renderFromCache() with
  shared drawPixelWithRenderMode() from DitherUtils.h
- This also hoists getRenderMode() out of the per-pixel call since
  drawPixelWithRenderMode handles it internally
martinbrook added a commit to martinbrook/crosspoint-reader that referenced this pull request Feb 5, 2026
Address review comment crosspoint-reader#4:
- Replace hand-rolled pixel rendering logic in renderFromCache() with
  shared drawPixelWithRenderMode() from DitherUtils.h
- This also hoists getRenderMode() out of the per-pixel call since
  drawPixelWithRenderMode handles it internally
martinbrook added a commit to martinbrook/crosspoint-reader that referenced this pull request Feb 5, 2026
Address review comment crosspoint-reader#4:
- Replace hand-rolled pixel rendering logic in renderFromCache() with
  shared drawPixelWithRenderMode() from DitherUtils.h
- This also hoists getRenderMode() out of the per-pixel call since
  drawPixelWithRenderMode handles it internally
martinbrook added a commit to martinbrook/crosspoint-reader that referenced this pull request Feb 8, 2026
Address review comment crosspoint-reader#4:
- Replace hand-rolled pixel rendering logic in renderFromCache() with
  shared drawPixelWithRenderMode() from DitherUtils.h
- This also hoists getRenderMode() out of the per-pixel call since
  drawPixelWithRenderMode handles it internally
madeddie pushed a commit to madeddie/crosspoint-reader that referenced this pull request Feb 11, 2026
Address review comment crosspoint-reader#4:
- Replace hand-rolled pixel rendering logic in renderFromCache() with
  shared drawPixelWithRenderMode() from DitherUtils.h
- This also hoists getRenderMode() out of the per-pixel call since
  drawPixelWithRenderMode handles it internally
martinbrook added a commit to martinbrook/crosspoint-reader that referenced this pull request Feb 13, 2026
Address review comment crosspoint-reader#4:
- Replace hand-rolled pixel rendering logic in renderFromCache() with
  shared drawPixelWithRenderMode() from DitherUtils.h
- This also hoists getRenderMode() out of the per-pixel call since
  drawPixelWithRenderMode handles it internally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant