Skip to content
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

feat: improve synchronization #13

Closed
wants to merge 3 commits into from

Conversation

rushiiMachine
Copy link
Member

  • Don't lock everything when hooking different methods
  • Don't sort callbacks for no reason
  • Other micro-optimizations

- Don't lock everything when hooking different methods
- Don't sort callbacks for no reason
- Other micro-optimizations
@Vendicated
Copy link
Member

Vendicated commented Sep 11, 2024

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

@Vendicated Vendicated closed this Sep 11, 2024
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