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

Store enum tags as a u16 instead of a u64 #785

Closed
yorickpeterse opened this issue Dec 10, 2024 · 0 comments
Closed

Store enum tags as a u16 instead of a u64 #785

yorickpeterse opened this issue Dec 10, 2024 · 0 comments
Assignees
Labels
compiler Changes related to the compiler feature New things to add to Inko, such as a new standard library module performance Changes related to improving performance
Milestone

Comments

@yorickpeterse
Copy link
Collaborator

The compiler restricts the number of enum constructors to u16::MAX aka 65 535, but we still store the tag as a regular Int, which is 64 bits. We should change this to use a u16 instead, reducing the size of enums (depending on the alignment of any wrapped data of course).

This should be done after #783 is merged.

@yorickpeterse yorickpeterse added compiler Changes related to the compiler performance Changes related to improving performance labels Dec 10, 2024
@yorickpeterse yorickpeterse added this to the 0.18.0 milestone Dec 10, 2024
@yorickpeterse yorickpeterse self-assigned this Dec 10, 2024
@yorickpeterse yorickpeterse changed the title Store enum tags as a u16 Store enum tags as a u16 instead of a u64 Dec 10, 2024
@yorickpeterse yorickpeterse added the feature New things to add to Inko, such as a new standard library module label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Changes related to the compiler feature New things to add to Inko, such as a new standard library module performance Changes related to improving performance
Projects
None yet
Development

No branches or pull requests

1 participant