Skip to content

Feature/epg refresh performance optimization#317

Open
saidai-bhuvanesh wants to merge 4 commits into
ProdigyV21:mainfrom
saidai-bhuvanesh:feature/epg-refresh-performance-optimization
Open

Feature/epg refresh performance optimization#317
saidai-bhuvanesh wants to merge 4 commits into
ProdigyV21:mainfrom
saidai-bhuvanesh:feature/epg-refresh-performance-optimization

Conversation

@saidai-bhuvanesh
Copy link
Copy Markdown

📝 Description

This PR introduces a set of reliability and performance improvements for the IPTV and EPG loading pipeline.

Reliability Improvements

XMLTV Parsing Optimization

Improved BackslashEscapeSanitizingInputStream to correctly process bulk reads used by XML parsers.

Previously, sanitization logic was only applied to single-byte reads, allowing malformed XMLTV data to bypass sanitization during normal parser execution.

The implementation now performs efficient block-based sanitization while preserving compatibility with existing XMLTV workflows.

Concurrent Playlist Aggregation Safety

Resolved a concurrency issue during simultaneous playlist loading where channel aggregation callbacks could trigger ConcurrentModificationException while playlists were being processed concurrently.

Channel snapshots are now generated using synchronized access before UI updates are dispatched.


Performance Improvements

Guide Key Candidate Caching

Added an in-memory cache for guide key candidate generation to reduce repeated normalization and alias generation work during EPG matching.

HTTP Conditional Requests

Added support for:

  • ETag caching
  • Last-Modified caching
  • HTTP 304 Not Modified handling

This allows unchanged EPG sources to reuse existing guide data without reprocessing large XMLTV datasets.

Incremental EPG Refresh

Improved refresh workflows to avoid unnecessary index persistence and guide regeneration when XMLTV content has not changed.

This reduces disk operations and refresh overhead for large IPTV installations.


Test Coverage

Added dedicated tests covering:

  • XMLTV sanitization bulk reads
  • Escape sequence boundary conditions
  • Trailing escape handling
  • Concurrent playlist aggregation safety
  • Guide key cache behavior
  • HTTP 304 EPG refresh handling

Benefits

  • Improved IPTV stability
  • Improved EPG reliability
  • Reduced concurrent update failures
  • Reduced EPG processing overhead
  • Improved guide refresh performance
  • Better scalability for large IPTV libraries

Testing

  • Verified IPTV playlist loading
  • Verified EPG refresh workflows
  • Verified XMLTV parsing behavior
  • Verified cache behavior
  • Verified concurrency handling
  • Added automated regression tests

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.

2 participants