Skip to content

fix(YouTube/Music): prevent GC pressure concurrence #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

0xrxL
Copy link

@0xrxL 0xrxL commented Apr 23, 2025

This issue can lead to a battery consuption increase of 5/10% per hour.

@0xrxL
Copy link
Author

0xrxL commented Apr 23, 2025

@inotia00 take this change with a grain of salt. The only test I did was on my main device, and it worked. Let others who have problems with battery consumption also try it out.

@YT-Advanced
Copy link

YT-Advanced commented Apr 24, 2025

It would be great if someone implement Aho Corasick as a replacement of the Litho Component's Trie Search

@0xrxL
Copy link
Author

0xrxL commented Apr 24, 2025

It would be great if someone implement Aho Corasick as a replacement of the Litho Component's Trie Search

Almost useless, considering the general app performance without any bottleneck, such as 1.000.000 threads (and LinkedHashMap elements) spawned in matter of seconds to fetch the video stream.

Anyway...this is the second day in a row that I can reproduce the same battery behaviour with uTube, without any sign of overheating and "concurrence GC freed..." logs printed every second.

But I need other tests from other users, to have a confirmations about this fix.

Screenshot_20250424_064313_Device care

@YT-Advanced
Copy link

Almost useless, considering the general app performance without any bottleneck, such as 1.000.000 threads (and LinkedHashMap elements) spawned in matter of seconds to fetch the video stream.

I don't think so. From my side, RVX seems laggy when scrolling in feed. After that I untick all component-hiding patches and problem is no longer occur. Therefore, I sure that the cause is from the large amount of litho filter in RVX, which let the app itself do several search in litho and cause delay in layout update.

@0xrxL
Copy link
Author

0xrxL commented Apr 24, 2025

Almost useless, considering the general app performance without any bottleneck, such as 1.000.000 threads (and LinkedHashMap elements) spawned in matter of seconds to fetch the video stream.

I don't think so. From my side, RVX seems laggy when scrolling in feed. After that I untick all component-hiding patches and problem is no longer occur. Therefore, I sure that the cause is from the large amount of litho filter in RVX, which let the app itself do several search in litho and cause delay in layout update.

I had the same problem, but become noticeable only when video stream threads start to spamming in memory, otherwise the app was smooth enough.

In any case I converted every List and Stream of strings, in a Set of strings. This gave me a further smoothness.

Try to use this object type.

@0xrxL
Copy link
Author

0xrxL commented Apr 24, 2025

@YT-Advanced (for curiosity) I implemented the Aho-Corsack algorithm on my uTube client. I just need to fix one thing and I'll push the new code. If you're interested, use the uDrop patcher and try it on your device. 👍

@YT-Advanced
Copy link

@YT-Advanced (for curiosity) I implemented the Aho-Corsack algorithm on my uTube client. I just need to fix one thing and I'll push the new code. If you're interested, use the uDrop patcher and try it on your device. 👍

Cool. I will check it soon

@0xrxL
Copy link
Author

0xrxL commented Apr 24, 2025

@YT-Advanced Done. Try it! 👍

P.S: Seems really fast at a first look.

@YT-Advanced
Copy link

@YT-Advanced Done. Try it! 👍

P.S: Seems really fast at a first look.

Nice work. U can use this ones as a dependency instead

@0xrxL
Copy link
Author

0xrxL commented Apr 25, 2025

@YT-Advanced Pushed! 👍

@0xrxL 0xrxL force-pushed the patch-1 branch 2 times, most recently from a3a4aa0 to fb5d5bb Compare April 26, 2025 08:43
@0xrxL
Copy link
Author

0xrxL commented May 3, 2025

@YT-Advanced Try it! 👍

ReVanced/revanced-patches#4904

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