perf: optimize memory usage and cache efficiency for large datasets#318
Open
saidai-bhuvanesh wants to merge 8 commits into
Open
perf: optimize memory usage and cache efficiency for large datasets#318saidai-bhuvanesh wants to merge 8 commits into
saidai-bhuvanesh wants to merge 8 commits into
Conversation
added 8 commits
June 4, 2026 21:35
Owner
|
This looks like a useful memory/performance PR, especially for large IPTV playlists and EPG data, but it is not ready to merge yet. It currently conflicts with latest main in IptvRepository.kt and IptvRepositoryOptimizationTest.kt, likely because main already includes the recent IPTV/EPG refresh work from PR317. Please rebase this PR onto latest main and keep the current main behavior, then reapply only the extra memory optimizations from this PR. Also please remove trim.py from the PR. It looks like a local cleanup helper script, not project source code. After that I can re-check compile/tests. |
Contributor
Author
|
Few mins I will check that
…On Fri, 5 Jun, 2026, 8:36 pm Prodigy, ***@***.***> wrote:
*ProdigyV21* left a comment (ProdigyV21/ARVIO#318)
<#318 (comment)>
This looks like a useful memory/performance PR, especially for large IPTV
playlists and EPG data, but it is not ready to merge yet.
It currently conflicts with latest main in IptvRepository.kt and
IptvRepositoryOptimizationTest.kt, likely because main already includes the
recent IPTV/EPG refresh work from PR317. Please rebase this PR onto latest
main and keep the current main behavior, then reapply only the extra memory
optimizations from this PR.
Also please remove trim.py from the PR. It looks like a local cleanup
helper script, not project source code.
After that I can re-check compile/tests.
—
Reply to this email directly, view it on GitHub
<#318?email_source=notifications&email_token=BOC4WIBRT2FE2ZP6DFZPVHD46LOVVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRTGI4TENBSGMY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4632924231>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BOC4WIEHDFUIFLBQLDS6K2D46LOVVAVCNFSM6AAAAACZ3NFKHOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DMMZSHEZDIMRTGE>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/BOC4WIHLXBXLWQQFEDPXUEL46LOVVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRTGI4TENBSGMY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG>
and Android
<https://github.com/notifications/mobile/android/BOC4WIG2EUFLOTGX3QW3BCL46LOVVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRTGI4TENBSGMY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
Download it today!
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Contributor
Author
|
Rebased on the latest main and resolved conflicts.
Removed trim.py and isolated only the memory optimization changes from this
PR.
Verified:
- PlayDebug build passes
- SideloadDebug build passes
- Unit tests pass
- No duplicate PR316/PR317 functionality remains
Ready for retest.
…On Fri, Jun 5, 2026 at 8:37 PM bhuvanesh S ***@***.***> wrote:
Few mins I will check that
On Fri, 5 Jun, 2026, 8:36 pm Prodigy, ***@***.***> wrote:
> *ProdigyV21* left a comment (ProdigyV21/ARVIO#318)
> <#318 (comment)>
>
> This looks like a useful memory/performance PR, especially for large IPTV
> playlists and EPG data, but it is not ready to merge yet.
>
> It currently conflicts with latest main in IptvRepository.kt and
> IptvRepositoryOptimizationTest.kt, likely because main already includes the
> recent IPTV/EPG refresh work from PR317. Please rebase this PR onto latest
> main and keep the current main behavior, then reapply only the extra memory
> optimizations from this PR.
>
> Also please remove trim.py from the PR. It looks like a local cleanup
> helper script, not project source code.
>
> After that I can re-check compile/tests.
>
> —
> Reply to this email directly, view it on GitHub
> <#318?email_source=notifications&email_token=BOC4WIBRT2FE2ZP6DFZPVHD46LOVVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRTGI4TENBSGMY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4632924231>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BOC4WIEHDFUIFLBQLDS6K2D46LOVVAVCNFSM6AAAAACZ3NFKHOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DMMZSHEZDIMRTGE>
> .
> Triage notifications, keep track of coding agent tasks and review pull
> requests on the go with GitHub Mobile for iOS
> <https://github.com/notifications/mobile/ios/BOC4WIHLXBXLWQQFEDPXUEL46LOVVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRTGI4TENBSGMY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KUZTPN52GK4S7NFXXG>
> and Android
> <https://github.com/notifications/mobile/android/BOC4WIG2EUFLOTGX3QW3BCL46LOVVA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINRTGI4TENBSGMY2M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2K4ZTPN52GK4S7MFXGI4TPNFSA>.
> Download it today!
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR addresses Phase 5: Memory Optimization & Large Dataset Stability Audit.
It introduces critical memory optimizations to reduce allocation pressure, eliminate hidden memory leaks, and optimize cache structures across the IPTV repository, EPG index database, and image loading pipelines. These changes ensure better long-session stability and reduced heap usage, particularly when handling large IPTV playlists (50k+ channels) and dense EPG data on Android TV devices.
Key Changes
guideKeyCandidatesCachesize from16384to4096to save heap memory.invalidateCache().xmlChannelNameMapagainst active channels during XMLTV parsing, reducing the map size by ~95%.insertNowNextRows) into SQLite transactions, completely avoiding the massive temporary list allocation caused by the previous flattening approach.ProgramDedupKeyobject to preventStringBuilderallocations.rememberMetadataLogoImageLoaderinstances on the Home and Details screens which previously spawned multiple redundant thread pools and memory caches.context.imageLoader.Bitmap.Config.ARGB_8888overriding the globalRGB_565optimization.Verification
playDebugKotlintarget.