Permalink
Please sign in to comment.
Browse files
Reduce the size of static data in std_unicode::tables.
`BoolTrie` works well for sets of code points spread out through most of Unicode’s range, but is uses a lot of space for sets with few, mostly low, code points. This switches a few of its instances to a similar but simpler trie data structure. ## Before `size_of::<BoolTrie>()` is 1552, which is added to `table.r3.len() * 8 + t.r5.len() + t.r6.len() * 8`: * `Cc_table`: 1632 * `White_Space_table`: 1656 * `Pattern_White_Space_table`: 1640 * Total: 4928 bytes ## After `size_of::<SmallBoolTrie>()` is 32, which is added to `t.r1.len() + t.r2.len() * 8`: * `Cc_table`: 51 * `White_Space_table`: 273 * `Pattern_White_Space_table`: 193 * Total: 517 bytes ## Difference Every Rust program with `std` statically linked should be about 4 KB smaller.
- Loading branch information...
Showing
with
110 additions
and 220 deletions.
- +7 −6 .gitignore
- +58 −6 src/etc/unicode.py
- +45 −208 src/libstd_unicode/tables.rs
13
.gitignore
Oops, something went wrong.
0 comments on commit
3b208d2