Skip to content

avoid loading constructor attributes in AdtDef decoding #54485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 24, 2018

Conversation

arielb1
Copy link
Contributor

@arielb1 arielb1 commented Sep 22, 2018

During metadata loading, the AdtDefs for every ADT in the universe need
to be loaded (for example, for coherence of builtin traits). For that,
the attributes of the AdtDef need to be loaded too.

The attributes of a struct are duplicated between 2 def ids - the
constructor def-id, and the "type" def id. Loading attributes for both
def-ids, which was done in #53721, slowed the compilation of small
crates by 2-3%. This PR makes sure we only load the attributes for the
"type" def-id, avoiding the slowdown.

r? @eddyb & cc @nnethercote

During metadata loading, the AdtDefs for every ADT in the universe need
to be loaded (for example, for coherence of builtin traits). For that,
the attributes of the AdtDef need to be loaded too.

The attributes of a struct are duplicated between 2 def ids - the
constructor def-id, and the "type" def id. Loading attributes for both
def-ids, which was done in rust-lang#53721, slowed the compilation of small
crates by 2-3%. This PR makes sure we only load the attributes for the
"type" def-id, avoiding the slowdown.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 22, 2018
@eddyb
Copy link
Member

eddyb commented Sep 23, 2018

Maybe we shouldn't even duplicate the attributes in the first place - but that could have very subtle consequences, so it's probably not worth it.

@bors r+

@bors
Copy link
Collaborator

bors commented Sep 23, 2018

📌 Commit 2c28c4e has been approved by eddyb

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 23, 2018
@bors
Copy link
Collaborator

bors commented Sep 23, 2018

⌛ Testing commit 2c28c4e with merge d4c6f40...

bors added a commit that referenced this pull request Sep 23, 2018
avoid loading constructor attributes in AdtDef decoding

During metadata loading, the AdtDefs for every ADT in the universe need
to be loaded (for example, for coherence of builtin traits). For that,
the attributes of the AdtDef need to be loaded too.

The attributes of a struct are duplicated between 2 def ids - the
constructor def-id, and the "type" def id. Loading attributes for both
def-ids, which was done in #53721, slowed the compilation of small
crates by 2-3%. This PR makes sure we only load the attributes for the
"type" def-id, avoiding the slowdown.

r? @eddyb & cc @nnethercote
@bors
Copy link
Collaborator

bors commented Sep 24, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: eddyb
Pushing d4c6f40 to master...

@bors bors merged commit 2c28c4e into rust-lang:master Sep 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants