Skip to content

use rune type instead of int for unicode tables #61

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

Luap99
Copy link

@Luap99 Luap99 commented Jul 2, 2025

int is 64 bit on 64 bit platforms but each unicode char is only 32bit and go APIs generally use rune as type for it so switch to that.

The main motivation is to reduce the binary size with a small example program I see a about 170k reduce binary size footprint.

Note I went with minimal changes in terms of changing the API of various internal functions and cast back to int quite early. In theory one could make much more changes to use rune over int.

int is 64 bit on 64 bit platforms but each unicode char is only 32bit
and go APIs generally use rune as type for it so switch to that.

The main motivation is to reduce the binary size with a small example
program I see a about 170k reduce binary size footprint.

Note I went with minimal changes in terms of changing the API of various
internal functions and cast back to int quite early. In theory one could
make much more changes to use rune over int.

Signed-off-by: Paul Holzinger <[email protected]>
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.

1 participant