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

Improve the inlining optimization to handle derived instances well #3186

Open
lukaszcz opened this issue Nov 22, 2024 · 0 comments · May be fixed by #3189
Open

Improve the inlining optimization to handle derived instances well #3186

lukaszcz opened this issue Nov 22, 2024 · 0 comments · May be fixed by #3189
Assignees
Labels
core Related to JuvixCore deriving enhancement New feature or request optimization traits
Milestone

Comments

@lukaszcz
Copy link
Collaborator

lukaszcz commented Nov 22, 2024

Currently, derived instances which are recursive are inefficient, because the recursive call is done via the generic Eq.eq instead of calling the function being defined directly. Thus a recursive call is compiled to a case on the instance of Eq to fetch the function to be called. This instance should be inlined and the case eliminated. It currently isn't unless the pragma inline: case is present. This situation should be detected automatically.

@lukaszcz lukaszcz added this to the 0.6.9 milestone Nov 22, 2024
@lukaszcz lukaszcz self-assigned this Nov 22, 2024
@lukaszcz lukaszcz linked a pull request Nov 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to JuvixCore deriving enhancement New feature or request optimization traits
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant