Skip to content

perf(media): support multi-million-file MiSTer libraries #292

Description

@rittwage

Original failure

A MiSTer library containing roughly 2.5 million files produced a media.db around 1.5 GB. Initial indexing took approximately 4.5 hours, interrupted reindexing could exhaust memory, and opening systems failed with BrowseRouteCounts context-deadline errors. The reporter supplied the database for development and hardware testing.

Indexing cannot be disabled: Core’s indexed media identity is the foundation for browsing, folder routing, launch resolution, metadata, favorites, and history. A filename-only frontend mode would create a separate incompatible browse stack.

Resolution

ZaparooProject/zaparoo-core#1040 hardened extreme-library behavior:

  • SQL scan staging instead of loading scanner resume state into RAM
  • Bounded interrupted-index recovery
  • Smaller commit batches and WAL checkpoint handling
  • Cached media counts, systems, tags, and browse routes
  • Browse-cache healing and rebuild support
  • Fresh-database query-planner statistics
  • Low-priority and gameplay-aware background work
  • Per-system indexing progress
  • Hardware verification against the supplied large database

Current Core #1239 and frontend #377 add further Core-owned browse fast paths and bounded frontend pagination/cache behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions