Skip to content

use rune type instead of int for unicode tables#61

Open
Luap99 wants to merge 1 commit into
rivo:masterfrom
Luap99:binsize
Open

use rune type instead of int for unicode tables#61
Luap99 wants to merge 1 commit into
rivo:masterfrom
Luap99:binsize

Conversation

@Luap99

@Luap99 Luap99 commented Jul 2, 2025

Copy link
Copy Markdown

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 <pholzing@redhat.com>
@Luap99

Luap99 commented Aug 20, 2025

Copy link
Copy Markdown
Author

@rivo Could you take look here please?

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