diff options
| author | bors <bors@rust-lang.org> | 2019-10-17 10:45:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-10-17 10:45:09 +0000 |
| commit | ea45150837990ccf40edfe2725ac492fc35193a1 (patch) | |
| tree | 17b0dd4e69fc651bb9166716911814581229b546 /src/test/ui/iterators/iter-sum-overflow-debug.rs | |
| parent | a16dca337de610986252bb800953e57bf395863f (diff) | |
| parent | d89dddc9204a540efcd7f86c36d60381020b2422 (diff) | |
| download | rust-ea45150837990ccf40edfe2725ac492fc35193a1.tar.gz rust-ea45150837990ccf40edfe2725ac492fc35193a1.zip | |
Auto merge of #59953 - eddyb:soa-metadata, r=michaelwoerister
rustc_metadata: replace Entry table with one table for each of its fields (AoS -> SoA).
In https://github.com/rust-lang/rust/pull/59789#issuecomment-481958212 I noticed that for many cross-crate queries (e.g. `predicates_of(def_id)`), we were deserializing the `rustc_metadata::schema::Entry` for `def_id` *only* to read one field (i.e. `predicates`).
But there are several such queries, and `Entry` is not particularly small (in terms of number of fields, the encoding itself is quite compact), so there is a large (and unnecessary) constant factor.
This PR replaces the (random-access) array¹ of `Entry` structures ("AoS"), with many separate arrays¹, one for each field that used to be in `Entry` ("SoA"), resulting in the ability to read individual fields separately, with negligible time overhead (in thoery), and some size overhead (as these arrays are not sparse).
In a way, the new approach is closer to incremental on-disk caches, which store each query's cached results separately, but it would take significantly more work to unify the two.
For stage1 `libcore`'s metadata blob, the size overhead is `8.44%`, and I have another commit (~~not initially included because I want to do perf runs with both~~ **EDIT**: added it now) that brings it down to `5.88%`.
¹(in the source, these arrays are called "tables", but perhaps they could use a better name)
Diffstat (limited to 'src/test/ui/iterators/iter-sum-overflow-debug.rs')
0 files changed, 0 insertions, 0 deletions
