Aliucord / hook

Java Xposed Api for LSPlant
Open Software License 3.0
123 stars 28 forks source link

feat: improve synchronization #13

Closed rushiiMachine closed 2 months ago

rushiiMachine commented 2 months ago
Vendicated commented 2 months ago

like i told you on discord, these changes makes very little sense

your new hookMethod is overly overcomplicated and has multiple potentials for data races. and the synchronisation on adding hooks is not performance relevant as an application is only gonna add a few hundred hooks

your changes to CopyOnWriteSortedSet also make no sense. why remove the deduplication? why rename it? why make indexOf static? based on the PR title I assume you think this will improve performance but this structure is only used to store patches for one method, and thus will never exceed a few dozen elements, so the indexOf for deduplication is virtually free

overall this just makes code more complicated and arguably worse for incredibly minimal microoptimisations