Stream: t-compiler/wg-incr-comp

Topic: DefPath-relative expansions


view this post on Zulip cjgillot (Apr 04 2021 at 12:39):

Hi @Vadim Petrochenkov, I stumbled upon https://github.com/rust-lang/rust/issues/49300#issuecomment-525531109 recently.
Has this proposal ever been implemented? Do you still think it worth pursuing?

view this post on Zulip Vadim Petrochenkov (Apr 04 2021 at 13:17):

IIRC, @Aaron Hill tried it when implementing https://github.com/rust-lang/rust/pull/72121 and it was found too expensive to construct a DefPath and DefId for every expansion.

view this post on Zulip Aaron Hill (Apr 04 2021 at 13:20):

That's correct

view this post on Zulip Vadim Petrochenkov (Apr 04 2021 at 13:21):

So ExpnIds don't currently have a stable representation, but are instead serialized as is (as crate-local IDs) and then somehow remapped into fresh crate-local ExpnIds during deserialization, I don't remember the details.

view this post on Zulip bjorn3 (Apr 04 2021 at 13:25):

https://github.com/rust-lang/rust/blob/f98135b7a24a54964f83ca1dc2dfb6bd1d35b1bd/compiler/rustc_span/src/hygiene.rs#L1081

view this post on Zulip cjgillot (Apr 04 2021 at 14:02):

Ok, I did not realize that creating a DefPath was that costly. Did you try having ExpnId relative to DefPath, without actually creating a DefPath?

view this post on Zulip Aaron Hill (Apr 04 2021 at 15:50):

Here's the perf run from when I tried it: https://github.com/rust-lang/rust/pull/72121#issuecomment-627093462

view this post on Zulip Aaron Hill (Apr 04 2021 at 15:51):

there was some other hygiene stuff mixed in with that commit, so that perf run might be an overestimate

view this post on Zulip cjgillot (Apr 04 2021 at 15:52):

The diff between the first and the last perf run allows to remove this overestimate.

view this post on Zulip Aaron Hill (Apr 04 2021 at 15:54):

I don't think any of the (non-incremental) def path table stuff has changed since I did that perf run

view this post on Zulip Aaron Hill (Apr 04 2021 at 15:54):

but take that perf run with a grain of salt

view this post on Zulip Vadim Petrochenkov (Apr 04 2021 at 20:45):

I'll ask some silly questions:


Last updated: Oct 21 2021 at 21:32 UTC