about summary refs log tree commit diff
path: root/src/liballoc_system
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-01-07 21:28:47 +0000
committerbors <bors@rust-lang.org>2017-01-07 21:28:47 +0000
commit089682611f055ca6315e2229e5ed29be3d2b41c8 (patch)
treef591e410c587ed49234a0e6b086de0a5be791f64 /src/liballoc_system
parentb97b60521199c9232cb42bbba87d53568fb29841 (diff)
parent3b208d2dac15237a46eb82c03bcc70a2b1165d20 (diff)
downloadrust-089682611f055ca6315e2229e5ed29be3d2b41c8.tar.gz
rust-089682611f055ca6315e2229e5ed29be3d2b41c8.zip
Auto merge of #38781 - SimonSapin:unishrink, r=alexcrichton
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.

CC @raphlinus, who wrote the original `BoolTrie`.

## 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.
Diffstat (limited to 'src/liballoc_system')
0 files changed, 0 insertions, 0 deletions