about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-12-30 05:43:39 +0000
committerbors <bors@rust-lang.org>2023-12-30 05:43:39 +0000
commitfe2cfd45055abfde24cb372a311095c105265236 (patch)
tree189afd6078760a39195e41af43288d8ff5054bbf /compiler/rustc_mir_transform/src/errors.rs
parent8d76d076665f862ec9619f2de68d6d9ca1db4601 (diff)
parent09e619d62eedee6fb67ae677923c53136a9bf51c (diff)
downloadrust-fe2cfd45055abfde24cb372a311095c105265236.tar.gz
rust-fe2cfd45055abfde24cb372a311095c105265236.zip
Auto merge of #119367 - Mark-Simulacrum:relative-spans, r=wesleywiser
Shrink span encoding further

Spans are now stored in a more compact form which cuts down on at least 1 byte per span (indirect/direct encoding) and at most 3 bytes per span (indirect/direct encoding, context byte, length byte). As a result, libcore metadata shrinks by 1.5MB.

I'm not a huge fan of the fairly manual encoding/decoding from bits implemented here. Something like Tokio's pack abstraction (https://github.com/tokio-rs/tokio/blob/master/tokio/src/util/bit.rs) might be desirable to cut down on some of the shifting etc. We might also say that this isn't worth doing :)

I took a look at copying the span encoding we use in memory (described [here](https://github.com/rust-lang/rust/blob/master/compiler/rustc_span/src/span_encoding.rs)). I think the format there makes a lot more sense for in-memory storage where prioritizing a fixed length (i.e., 4 or 8 bytes) is much more important. In metadata, it's much easier for us to have variable-length values, so there's less of a cliff if we don't quite fit. The bit packing scheme there would need changes to fit the varint scheme since it has a lot of all-1s patterns as the "relative offset" form.
Diffstat (limited to 'compiler/rustc_mir_transform/src/errors.rs')
0 files changed, 0 insertions, 0 deletions