]> git.lizzy.rs Git - rust.git/commit
Use a `newtype_index!` within `Symbol`.
authorNicholas Nethercote <nnethercote@mozilla.com>
Mon, 10 Dec 2018 22:06:51 +0000 (09:06 +1100)
committerNicholas Nethercote <nnethercote@mozilla.com>
Tue, 11 Dec 2018 21:38:08 +0000 (08:38 +1100)
commit0f68749260d04b61dfe2b38dbc423aefe2914a58
tree272c64f618d7b60c99b5795d749440e5e5ce0142
parentb755501043d5b27b39f94bcadd57c8d5dedfd6ba
Use a `newtype_index!` within `Symbol`.

This shrinks `Option<Symbol>` from 8 bytes to 4 bytes, which shrinks
`Token` from 24 bytes to 16 bytes. This reduces instruction counts by up
to 1% across a range of benchmarks.
src/libsyntax/parse/token.rs
src/libsyntax_pos/lib.rs
src/libsyntax_pos/symbol.rs