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

Migrate Adventure mappers to MethodHandles #300

Open
1 task done
joshuasing opened this issue Oct 3, 2023 · 0 comments
Open
1 task done

Migrate Adventure mappers to MethodHandles #300

joshuasing opened this issue Oct 3, 2023 · 0 comments
Labels
size: L status: future This might be done in the future type: enhancement This is a feature request or a pull request that adds a feature type: performance type: refactor This refactors existing code
Milestone

Comments

@joshuasing
Copy link
Member

Confirmation

  • I have checked for similar issues.

Problem

The Adventure mappers currently use Reflection to invoke "platform Adventure" methods.
Reflection is known to be slow, and this can have an impact on performance on platforms where this is required.

Suggested solution

MethodHandles provide an alternative way to invoke methods, whilst being faster than Reflection. However, they are a little bit more complicated and harder to use than Reflection. Additionally, MethodHandles are typed.

If done correctly, I believe moving to MethodHandles would greatly improve the performance of the Adventure mappers, and may allow us to improve the mappers at the same time. Additionally, given MethodHandles are typed, we may be able to catch more issues at compile-time.

Additional information

No response

@joshuasing joshuasing added type: enhancement This is a feature request or a pull request that adds a feature status: future This might be done in the future type: refactor This refactors existing code type: performance size: L labels Oct 3, 2023
@joshuasing joshuasing added this to the v0.21.0 milestone Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: L status: future This might be done in the future type: enhancement This is a feature request or a pull request that adds a feature type: performance type: refactor This refactors existing code
Projects
None yet
Development

No branches or pull requests

1 participant