]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #12635 : alexcrichton/rust/speedy-hash, r=brson
authorbors <bors@rust-lang.org>
Fri, 7 Mar 2014 02:16:39 +0000 (18:16 -0800)
committerbors <bors@rust-lang.org>
Fri, 7 Mar 2014 02:16:39 +0000 (18:16 -0800)
This leverages the new hashing framework and hashmap implementation to provide a
much speedier hashing algorithm for node ids and def ids. The hash algorithm
used is currentl FNV hashing, but it's quite easy to swap out.

I originally implemented hashing as the identity function, but this actually
ended up in slowing down rustc compiling libstd from 8s to 13s. I would suspect
that this is a result of a large number of collisions.

With FNV hashing, we get these timings (compiling with --no-trans, in seconds):

|           |  before  |  after  |
|-----------|---------:|--------:|
| libstd    |   8.324  |  6.703  |
| stdtest   |  47.674  | 46.857  |
| libsyntax |   9.918  |  8.400  |


Trivial merge