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

Optimize binary size a bit #20

Open
mbeckem opened this issue Aug 1, 2021 · 1 comment
Open

Optimize binary size a bit #20

mbeckem opened this issue Aug 1, 2021 · 1 comment
Labels
idea Proposals that have not been committed to yet

Comments

@mbeckem
Copy link
Owner

mbeckem commented Aug 1, 2021

Possible opportunities for saving some code size:

  • Better compression of unicode table in common/text/unicode_data.cpp
    • Lots of space is wasted because all entries use 4 byte code point values. Code point ranges in [0, 256) and [256, 65536) can use a different layout.
    • Note that the source file is generated by a python script (which should also be migrated to cog)
  • Wrapper around absl::flat_hash_set(/table) for maps and sets of Id keys (e.g. InstId). All of those Id types are simple wrappers around integers (usually u32), but their template instantiations seem to be distinct. By creating a wrapper type that is a simple map of integers we could save some code, although probably not that much because the value the value types would still be distinct.
  • Look into the code size of fmt:: symbols

Tools like Bloaty are useful when working on this.

@mbeckem mbeckem added the idea Proposals that have not been committed to yet label Aug 1, 2021
@mbeckem
Copy link
Owner Author

mbeckem commented Nov 1, 2021

Unicode tables are a bit smaller now. General categories are longer stored, we only have information about XID_Start (+ Continue) and Whitespace. Tables are still not compressed in any way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
idea Proposals that have not been committed to yet
Projects
None yet
Development

No branches or pull requests

1 participant