-
Notifications
You must be signed in to change notification settings - Fork 110
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
fix(Spoof Streaming Data): Performance degradation on iOS client #110
Conversation
...hared/src/main/java/app/revanced/extension/shared/patches/spoof/SpoofStreamingDataPatch.java
Outdated
Show resolved
Hide resolved
? "Unknown" | ||
: lastSpoofedClientType.getFriendlyName(); | ||
} | ||
private static final Map<String, ClientType> clientTypeMap = Collections.synchronizedMap( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still using two HashMaps, so it's not good in terms of performance
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The performance difference is not noticeable at all (since videoId is used as key). For more information, before this PR you were using streamingData as the map key. It causes significant delay because the map has to hash the entire byte array.
...hared/src/main/java/app/revanced/extension/shared/patches/spoof/SpoofStreamingDataPatch.java
Outdated
Show resolved
Hide resolved
Additional context Before this PR, there was a delay of about 1 second for the video to start on iOS clients, because two HashMaps were used to find the original StreamingData The PR fixes that |
Still, there is a delay I will also consider skipping the videoId verification to further reduce the delay (Will be implemented as a setting) |
Uhm u shouldn't do it, since the original StreamingData may be spoofed incorrectly 🫠 Just keep things as they are |
Apply workarounds to
IOS
client only