Skip to content

refactor: replace type-id function with lookup table #15904

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BlobCodes
Copy link
Contributor

Since #15708 codegen now generates a function mapping type-ids to strings.

This MR replaces this function with a const array, saving ca 7kB of binary size in a hello world application.

That's not really much in crystal terms, but it's simpler and should be easier to use for debugging purposes.

Copy link
Contributor

@ysbaddaden ysbaddaden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is pretty nice!

@straight-shoota straight-shoota modified the milestone: 1.17.0 Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants