Skip to content

musikr: batch cache writes to reduce fsync overhead on cold scan - #1365

Open
shapeshed wants to merge 1 commit into
OxygenCobalt:devfrom
shapeshed:perf/batch-cache-writes
Open

musikr: batch cache writes to reduce fsync overhead on cold scan#1365
shapeshed wants to merge 1 commit into
OxygenCobalt:devfrom
shapeshed:perf/batch-cache-writes

Conversation

@shapeshed

Copy link
Copy Markdown

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of changes

Replace per-song Room inserts with chunked bulk inserts (500 songs per transaction). Reduces ~3000 individual fsync calls to ~6 on a full cold scan, cutting write time from seconds to milliseconds on typical eMMC/UFS storage. Adds writeAll() to MutableCache with a default fallback for external implementors, and unit tests for the chunking behaviour.

Fixes the following issues

None. This is a performance improvement

Any additional information

None

APK testing

Due diligence

Replace per-song Room inserts with chunked bulk inserts (500 songs per
transaction). Reduces ~3000 individual fsync calls to ~6 on a full
cold scan, cutting write time from seconds to milliseconds on typical
eMMC/UFS storage. Adds writeAll() to MutableCache with a default
fallback for external implementors, and unit tests for the chunking
behaviour.
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