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

Create structs for type classes #53

Open
felixSchl opened this issue Nov 8, 2018 · 1 comment
Open

Create structs for type classes #53

felixSchl opened this issue Nov 8, 2018 · 1 comment

Comments

@felixSchl
Copy link
Collaborator

The current dictionary-based approach has poor performance because the dictionaries are frequently allocated and released, meaning that strings (keys) are frequently allocated and released as well. Considering that the dictionary is completely known a priori we might as well emit matching structs or use some purs_any_t ** and access them by some known pointer offset by key.

@felixSchl
Copy link
Collaborator Author

felixSchl commented Feb 19, 2021

This comment still holds true in part, however, top-level thunks are now cached and only evaluated once during the program's runtime. Another idea I had to perhaps squeeze out a bit more performance improvements without relying on upstream support for this feature is to pre-hash the keys into the dictionary for generated code.

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