Skip to content

Speed up EPG sync: increase batch insert size 500→5000 - #171

Open
disclosurez wants to merge 1 commit into
Davidona:masterfrom
disclosurez:epg-batch-optimization
Open

Speed up EPG sync: increase batch insert size 500→5000#171
disclosurez wants to merge 1 commit into
Davidona:masterfrom
disclosurez:epg-batch-optimization

Conversation

@disclosurez

Copy link
Copy Markdown
Contributor

Increases EPG_PROGRAM_BATCH_SIZE and STALKER_GUIDE_PROGRAM_BATCH_SIZE from 500 to 5000 rows per transaction.

During EPG sync, XMLTV programs are stream-parsed and inserted in batches. Each batch runs a separate SQLite transaction. With 500 rows per batch, a large EPG dataset (e.g. 300K programs) requires 600 transactions. Increasing to 5000 reduces this to 60 transactions — a 10x reduction in transaction overhead.

Files changed

  • data/.../repository/EpgRepositoryImpl.kt — EPG_PROGRAM_BATCH_SIZE 500→5000
  • data/.../sync/SyncManager.kt — STALKER_GUIDE_PROGRAM_BATCH_SIZE 500→5000

EPG_PROGRAM_BATCH_SIZE and STALKER_GUIDE_PROGRAM_BATCH_SIZE increased
from 500 to 5000, reducing SQLite transaction overhead by 10x during
EPG data ingestion. Each batch insert now commits 5000 rows instead of
500, significantly reducing total sync time for large EPG datasets.
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