Skip to content

Fix metadata stats. #97384

New issue

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

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

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 25, 2022
Merged

Fix metadata stats. #97384

merged 1 commit into from
May 25, 2022

Conversation

nnethercote
Copy link
Contributor

This commit:

  • Counts some things that weren't being counted previously, and adds
    an assertion that ensure everything is counted.
  • Reorders things so the eprintlns order matches the code order.
  • Adds percentages, and makes clear that the zero bytes count is orthogonal to
    the other measurements.

Example of the new output:

55463779 metadata bytes, of which 18054531 bytes (32.6%) are zero
             preamble:       30 bytes ( 0.0%)
                  dep:        0 bytes ( 0.0%)
          lib feature:    17458 bytes ( 0.0%)
            lang item:      337 bytes ( 0.0%)
      diagnostic item:     1788 bytes ( 0.0%)
           native lib:        0 bytes ( 0.0%)
      foreign modules:     5113 bytes ( 0.0%)
       def-path table:   720180 bytes ( 1.3%)
               traits:      359 bytes ( 0.0%)
                impls:    64624 bytes ( 0.1%)
     incoherent_impls:      130 bytes ( 0.0%)
                  mir: 16137354 bytes (29.1%)
                 item: 23773099 bytes (42.9%)
interpret_alloc_index:      599 bytes ( 0.0%)
      proc-macro-data:        0 bytes ( 0.0%)
               tables: 10081135 bytes (18.2%)
 debugger visualizers:        0 bytes ( 0.0%)
     exported symbols:     5666 bytes ( 0.0%)
              hygiene:  1539390 bytes ( 2.8%)
      def-path hashes:  2752564 bytes ( 5.0%)
           source_map:   363540 bytes ( 0.7%)
                final:      413 bytes ( 0.0%)

r? @bjorn3

This commit:
- Counts some things that weren't being counted previously, and adds
  an assertion that ensure everything is counted.
- Reorders things so the `eprintln`s order matches the code order.
- Adds percentages, and makes clear that the zero bytes count is orthogonal to
  the other measurements.

Example of the new output:
```
55463779 metadata bytes, of which 18054531 bytes (32.6%) are zero
             preamble:       30 bytes ( 0.0%)
                  dep:        0 bytes ( 0.0%)
          lib feature:    17458 bytes ( 0.0%)
            lang item:      337 bytes ( 0.0%)
      diagnostic item:     1788 bytes ( 0.0%)
           native lib:        0 bytes ( 0.0%)
      foreign modules:     5113 bytes ( 0.0%)
       def-path table:   720180 bytes ( 1.3%)
               traits:      359 bytes ( 0.0%)
                impls:    64624 bytes ( 0.1%)
     incoherent_impls:      130 bytes ( 0.0%)
                  mir: 16137354 bytes (29.1%)
                 item: 23773099 bytes (42.9%)
interpret_alloc_index:      599 bytes ( 0.0%)
      proc-macro-data:        0 bytes ( 0.0%)
               tables: 10081135 bytes (18.2%)
 debugger visualizers:        0 bytes ( 0.0%)
     exported symbols:     5666 bytes ( 0.0%)
              hygiene:  1539390 bytes ( 2.8%)
      def-path hashes:  2752564 bytes ( 5.0%)
           source_map:   363540 bytes ( 0.7%)
                final:      413 bytes ( 0.0%)
```
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label May 25, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 25, 2022
@bjorn3
Copy link
Member

bjorn3 commented May 25, 2022

Nice!

@bors r+

@bors
Copy link
Collaborator

bors commented May 25, 2022

📌 Commit 9a926e5 has been approved by bjorn3

@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 May 25, 2022
@nnethercote
Copy link
Contributor Author

@bors rollup=always

bors added a commit to rust-lang-ci/rust that referenced this pull request May 25, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#95953 (Modify MIR building to drop repeat expressions with length zero)
 - rust-lang#96913 (RFC3239: Implement `cfg(target)` - Part 2)
 - rust-lang#97233 ([RFC 2011] Library code)
 - rust-lang#97370 (Minor improvement on else-no-if diagnostic)
 - rust-lang#97384 (Fix metadata stats.)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 3c11bf3 into rust-lang:master May 25, 2022
@rustbot rustbot added this to the 1.63.0 milestone May 25, 2022
@nnethercote nnethercote deleted the fix-metadata-stats branch May 25, 2022 23:17
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Sep 21, 2022
…bjorn3

Improve `-Zmeta-stats` some more

A follow-up to rust-lang#97384.

r? `@bjorn3`
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Sep 21, 2022
…bjorn3

Improve `-Zmeta-stats` some more

A follow-up to rust-lang#97384.

r? ``@bjorn3``
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Sep 21, 2022
…bjorn3

Improve `-Zmeta-stats` some more

A follow-up to rust-lang#97384.

r? ```@bjorn3```
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants