benoitkugler / textlayout

Fonts and text layout for Golang
MIT License
47 stars 7 forks source link

glyphsnames: Use switch cases for lookups instead of huge maps #24

Closed Jacalz closed 1 year ago

Jacalz commented 1 year ago

This seems to increase binaries about 0.3MB but decrease memory usage by around 1MB. This is not super elegant but might be useful in the meantime. These maps were going away entirely when moving into the go-text project, right?

Jacalz commented 1 year ago

There are a lot of these huge maps scattered around. I guess this only is one part of it

benoitkugler commented 1 year ago

Thank you. The maps in the unicodedata package will remain in go-text, not the other ones. We could maybe see after the merge if this is an issue.

Jacalz commented 1 year ago

Alright. I will have a closer look and see also if some more maps can be moved over to using switch cases then :)