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

Variable name size can impact evaluation time? Or just drop the names #5834

Closed
effectfully opened this issue Mar 14, 2024 · 1 comment
Closed

Comments

@effectfully
Copy link
Contributor

@kwxm claims that the size of the name of a variable has impact on performance:

Even with unit annotations, textual programs were taking 2-3% longer than flat ones. It looks as if that was because the textual version (which I got by converting the flat file) was full of stuff like (lam i_2594 [ [ i_2591 [ i_2593 i_2593 ] ] i_2594 ]). The evaluator uses NamedDeBruijn terms and for the textual version those names were retained in the AST, but for the flat version the names were all "x", and it appears that the longer your names, the slower your program. An application of termMapNames seems to have fixed that.

I don't believe that this is an issue with the evaluator, but maybe there's some kind of laziness deferring deserialization or whatever to runtime. It would be good to look into this issue.

Alternatively, we can just make the CEK machine parameterized by the type of names (using a LookupName name env class or whatever), so that we don't need to juggle those performance-hurting textual names -- as we should've done originally anyway.

@effectfully
Copy link
Contributor Author

Closing in favor of a subtask in #5955.

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