Replace the unicode.data blob by a ruby constant
#561
Merged
+4,235
−20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ref: 1eb715d
It seems like this data was initially YAML, but 13 years ago various version of libyaml had issues, so Marshal was used.
The problem with marshal is it's a binary format, so while this data has no reason to change, it's hard to see what's in it.
I think a simple Ruby constant would work just as well. On my machine, both take as long to load, but many apps have bootsnap setup, so would probably load the ruby version faster than the marshal one.
Also as a sidenote, as far as I can tell,
COMPOSITION_TABLEis unused, getting rid of it would save a bit of memory and boot time.