Skip to content

perf: add 200MB image disk cache, RAM memory cache, and network connection pooling - #590

Open
neerajlovecyber wants to merge 2 commits into
NuvioMedia:Devfrom
neerajlovecyber:perf/desktop-caching-and-network-pooling
Open

neerajlovecyber wants to merge 2 commits into
NuvioMedia:Devfrom
neerajlovecyber:perf/desktop-caching-and-network-pooling

Conversation

@neerajlovecyber

Copy link
Copy Markdown
Contributor

Summary

Optimizes image caching, memory utilization, and network concurrency across NuvioDesktop:

  • Coil 3 Persistent Disk & RAM Cache: Added 200MB persistent disk cache in OS-standard cache directories (%LOCALAPPDATA%/Nuvio/image_cache\ on Windows, ~/Library/Caches/com.nuvio.app/image_cache\ on macOS, ~/.cache/nuvio/image_cache\ on Linux) and configured a 25% JVM heap \MemoryCache.
  • Addon & Trailer Connection Pooling: Configured OkHttp \ConnectionPool(16, 5 min)\ and high-concurrency dispatchers (\maxRequests = 64, \maxRequestsPerHost = 16) for addon scraping and trailer extraction.
  • DNS Sorter: Added \DesktopIPv4FirstDns\ to trailer extraction clients.

PR type

  • Small maintenance only, with no UI or behavior change

Why

  • Missing Coil persistent disk cache caused NuvioDesktop to re-download all posters, banners, and backdrops over the network on every app launch.
  • Default connection limits caused TLS connection overhead and queuing during multi-addon scraping.

Desktop scope

This change is 100% desktop-specific (\desktopMain):

  • Windows (%LOCALAPPDATA%), macOS (~/Library/Caches), Linux (~/.cache).
  • No \commonMain\ shared files were modified.

Issue or approval

No linked issue: performance and caching maintenance for desktop.

UI / behavior impact

  • No UI change
  • No behavior change

Policy check

  • I have read and understood \CONTRIBUTING.md.
  • This PR is small, focused, and limited to one problem.
  • This PR is scoped to the desktop app, desktop packaging, desktop documentation, or shared code required for desktop behavior.
  • This PR is not cosmetic-only.
  • Any UI change fixes a linked glitch/bug and includes visual proof, or this PR has no UI change.
  • Any behavior change fixes a linked bug/regression or has explicit approval, or this PR has no behavior change.
  • This PR does not bundle unrelated refactors, cleanups, formatting, or drive-by changes.
  • This PR does not add dependencies, architecture changes, migrations, or product-direction changes without explicit approval.
  • I listed the testing performed below.

Scope boundaries

  • Strictly touches desktop-specific caching and network infrastructure (\desktopMain).
  • No UI components, navigation, or database schemas were touched.

Testing

  • Desktop OS: Windows 11 x64.
  • Commands: ./gradlew :composeApp:compileKotlinDesktop.
  • Manual Verification:
    • Validated local cache creation in %LOCALAPPDATA%/Nuvio/image_cache.
    • Verified instant poster loading from disk on repeated launches.
    • Verified multi-addon scraping over pooled \desktopHttpClient\ sockets.

Screenshots / Video

Not a UI change

Breaking changes

None.

Linked issues

No linked issue: desktop performance and caching maintenance.

@neerajlovecyber

Copy link
Copy Markdown
Contributor Author

Hi @KhooLy , I forgot to mention this changes are just alining desktop behaviour with tv mostly 1:1

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