about summary refs log tree commit diff
path: root/src/test/run-pass/thinlto
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-11-04 16:49:29 -0700
committerAlex Crichton <alex@alexcrichton.com>2016-11-05 10:50:22 -0700
commit1ff3dfd25c91d1a007b2b764529e3914378b7150 (patch)
tree9a96da634c11a19fd0a2e37a5b54691f803bc4b6 /src/test/run-pass/thinlto
parent041f890cfe943741112232d394875f37a1659a07 (diff)
parentd73c68ceef6984b8e762a173b96279c42d1fe851 (diff)
downloadrust-1ff3dfd25c91d1a007b2b764529e3914378b7150.tar.gz
rust-1ff3dfd25c91d1a007b2b764529e3914378b7150.zip
Rollup merge of #37427 - nnethercote:opt-IchHasher, r=michaelwoerister
Reduce the number of bytes hashed by IchHasher.

IchHasher uses blake2b hashing, which is expensive, so the fewer bytes hashed
the better. There are two big ways to reduce the number of bytes hashed.
- Filenames in spans account for ~66% of all bytes (for builds with debuginfo).
  The vast majority of spans have the same filename for the start of the span
  and the end of the span, so hashing the filename just once in those cases is
  a big win.
- u32 and u64 and usize values account for ~25%--33% of all bytes (for builds
  with debuginfo). The vast majority of these are small, i.e. fit in a u8, so
  shrinking them down before hashing is also a big win.

This PR implements these two optimizations. I'm certain the first one is safe.
I'm about 90% sure that the second one is safe.

Here are measurements of the number of bytes hashed when doing
debuginfo-enabled builds of stdlib and
rustc-benchmarks/syntex-0.42.2-incr-clean.

```
                    stdlib   syntex-incr
                    ------   -----------
original       156,781,386   255,095,596
half-SawSpan   106,744,403   176,345,419
short-ints      45,890,534   118,014,227
no-SawSpan[*]    6,831,874    45,875,714

[*] don't hash the SawSpan at all. Not part of this PR, just implemented for
    comparison's sake.
```

For debug builds of syntex-0.42.2-incr-clean, the two changes give a 1--2%
speed-up.
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions