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

Nockma backend: reduce the number of things stored in closures #3042

Open
lukaszcz opened this issue Sep 14, 2024 · 0 comments
Open

Nockma backend: reduce the number of things stored in closures #3042

lukaszcz opened this issue Sep 14, 2024 · 0 comments

Comments

@lukaszcz
Copy link
Collaborator

lukaszcz commented Sep 14, 2024

I believe it's not necessary to store all this stuff in closures, or some rarely used stuff can be moved to one "extra" field, the pointer to which would be just passed around most of the time.

The point is that at each function call you need to create a list with all these things. Hence, the length of this list has a significant impact on the overall running time.

In a purely functional programming language, function calls are the main way of transferring control ("loops" are implemented with function calls) and functions themselves are typically small. This means that the total number of operations performed is proportional (with a relatively small constant) to the number of function calls. Hence, any constant factor inefficiency in function call implementation translates to a comparable constant factor slowdown of the entire program. Function calls need to be as efficient as possible.

@lukaszcz lukaszcz added this to the 0.6.8 milestone Sep 14, 2024
@lukaszcz lukaszcz self-assigned this Sep 14, 2024
@lukaszcz lukaszcz modified the milestones: 0.6.8, 0.6.7 Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant