Skip to content

rustdoc: Get rid of Item::Attributes #84304

Description

@jyn514

This is a special case of #76382. Attributes is 72 bytes large and used in quite a few places:

This has two downsides:

  1. Attributes takes up a lot of space in memory, so this bloats memory usage
  2. It means attributes have to calculated ahead of time, instead of on-demand. In particular, this requires adding a new attrs field whenever render needs to look at the attrs of a specific clean type (Add stability tags to ImportItem. #83900 (comment)).

It would be better to calculate this on-demand, so it uses less memory and doesn't have to be calculated for each and every item.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.I-compilememIssue: Problems and improvements with respect to memory usage during compilation.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions