about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-05-01 21:08:23 +0000
committerbors <bors@rust-lang.org>2020-05-01 21:08:23 +0000
commitdba944a6b79caf0056ddd282de01de70a0ff8a36 (patch)
treeb7834f3648b3421f8b79ad6e26e54e5d1a2a1477 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs
parent7f65393b9abf5e70d0b9a8080558f17c5625bd40 (diff)
parente4976d0caf6a4b9d9d3ec8979427c6e744c8c38d (diff)
downloadrust-dba944a6b79caf0056ddd282de01de70a0ff8a36.tar.gz
rust-dba944a6b79caf0056ddd282de01de70a0ff8a36.zip
Auto merge of #69808 - cjgillot:vtbl, r=pnkfelix
Avoid duplicating code for each query

There are at the moment roughly 170 queries in librustc.
The way `ty::query` is structured, a lot of code is duplicated for each query.
I suspect this to be responsible for a part of librustc'c compile time.

The first part of this PR reduces the amount of code generic on the query,
replacing it by code generic on the key-value types. I can split it out if needed.

In a second part, the non-inlined methods in the `QueryAccessors` and `QueryDescription` traits
are made into a virtual dispatch table. This allows to reduce even more the number of generated
functions.

This allows to save 1.5s on check build, and 10% on the size of the librustc.rlib.
(Attributed roughly half and half).
My computer is not good enough to measure properly compiling time.
I have no idea of the effect on performance. A perf run may be required.

cc #65031
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-md5.rs')
0 files changed, 0 insertions, 0 deletions