about summary refs log tree commit diff
path: root/src/test/run-pass/thinlto
diff options
context:
space:
mode:
authorKang Seonghoon <public+git@mearie.org>2017-03-22 03:27:06 +0900
committerAlex Crichton <alex@alexcrichton.com>2017-04-05 09:13:19 -0700
commit44bcd261a7fa2a4ad873a77b67ac88b0cf09f111 (patch)
treeb2e8ca1c198282e6d8d45b74cc90a18b95583b0e /src/test/run-pass/thinlto
parentad5dfecc6ae23bb7d2b8075d705011918ab4f399 (diff)
downloadrust-44bcd261a7fa2a4ad873a77b67ac88b0cf09f111.tar.gz
rust-44bcd261a7fa2a4ad873a77b67ac88b0cf09f111.zip
Reduce a table used for `Debug` impl of `str`.
This commit shrinks the size of the aforementioned table from
2,102 bytes to 1,197 bytes. This is achieved by an observation that
most u16 entries are common in its upper byte. Specifically:

- SINGLETONS now uses two tables, one for (upper byte, lower count)
  and another for a series of lower bytes. For each upper byte given
  number of lower bytes are read and compared.

- NORMAL now uses a variable length format for the count of "true"
  codepoints and "false" codepoints (one byte with MSB unset, or
  two big-endian bytes with the first MSB set).

The code size and relative performance roughly remains same as this
commit tries to optimize for both. The new table and algorithm has
been verified for the equivalence to older ones.
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions