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

Reduce binary size of the library #537

Merged
merged 2 commits into from
Mar 24, 2024
Merged

Conversation

nwellnhof
Copy link
Contributor

These two commits rework Unicode case folding and HTML entity lookup to reduce the size of the shared library from 345 KB to 202 KB on Ubuntu 22.04.

The generated switch statement compiled to around 85 KB of machine code
and rodata. Use a table and binary search instead, reducing the size of
the library from 345 to 272 KB on Ubuntu 22.04.

Replacement text is now preencoded as UTF-8.

This also removes the last Perl script from the repo.
The new layout saves about 20 KB and removes 50 KB of relocation
entries from the shared library, also speeding up loading.

Reduces the size of the shared library from 272 to 202 KB on Ubuntu
22.04.
@jgm
Copy link
Member

jgm commented Mar 24, 2024

Excellent!

@jgm jgm merged commit c91ced1 into commonmark:master Mar 24, 2024
15 checks passed
@nwellnhof nwellnhof deleted the shrink-tables branch March 25, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants