perf: Improve proxy performance
Feature description
Right now, the proxy function is implemented like this:
Make proxyPool a map for constant lookup.
Motivation
Proxy has linear time complexity and if you need to proxy many classes, it's quadratic. Making lookup constant would reduce complexity to linear for performance.
Acknowledgements
- [x] I have checked all open and closed feature requests and this is not a duplicate.
- [x] I have chosen an appropriate title.
- [x] All requested information has been provided properly.
@LisoUseInAIKyrios Does that make sense?
This is already implemented in
https://github.com/ReVanced/revanced-patcher/pull/329#issuecomment-2618629298
https://github.com/LisoUseInAIKyrios/revanced-patcher/blob/feat/instruction_filters/src/main/kotlin/app/revanced/patcher/util/PatchClasses.kt
The change also fixes an existing bug, where if a patch modified a method, then a different patch fingerprint matches a different part of the same method, then the match indexes returned by the second fingerprint are incorrect (it returns the pattern indexes of the unmodified method).
https://github.com/ReVanced/revanced-patcher/pull/329#issuecomment-2615313028
The bug has existed for a long time, but that change fixes it.
The bug has existed for a long time, but that change fixes it.
It was considered a non-bug. I was under the impression of fingerprints matching the real source, but it makes sense to make it respect past changes.