diff options
| author | Jubilee <workingjubilee@gmail.com> | 2025-06-24 19:45:33 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-24 19:45:33 -0700 |
| commit | b5631095cd3fec73737a3883b07fcb0d7dbdcfb7 (patch) | |
| tree | 2cbc122fa20cbf51662472cd1cb8acd428b115ac /src/doc | |
| parent | 4af75b24e41de034dace6d1515d29d82e5604038 (diff) | |
| parent | c3200c3bb54b94bafb0731adeffd2128f1d6cdd3 (diff) | |
Rollup merge of #142934 - nnethercote:tweak-macro-stats, r=petrochenkov
Tweak `-Zmacro-stats` measurement. It currently reports net size, i.e. size(output) - size(input). After some use I think this is sub-optimal, and it's better to just report size(output). Because for derive macros the input size is always 1, and for attribute macros it's almost always 1. r? ```@petrochenkov```
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/unstable-book/src/compiler-flags/macro-stats.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/doc/unstable-book/src/compiler-flags/macro-stats.md b/src/doc/unstable-book/src/compiler-flags/macro-stats.md index b2622cff057..f3fa69058a7 100644 --- a/src/doc/unstable-book/src/compiler-flags/macro-stats.md +++ b/src/doc/unstable-book/src/compiler-flags/macro-stats.md @@ -10,12 +10,12 @@ generated code is normally invisible to the programmer. This flag helps identify such cases. When enabled, the compiler measures the effect on code size of all used macros and prints a table summarizing that -effect. For each distinct macro, it counts how many times it is used, and the -net effect on code size (in terms of lines of code, and bytes of code). The +effect. For each distinct macro, it counts how many times it is used, and how +much code it produces when expanded (in lines of code, and bytes of code). The code size evaluation uses the compiler's internal pretty-printing, and so will be independent of the formatting in the original code. -Note that the net effect of a macro may be negative. E.g. the `cfg!` and +Note that the output size of a macro may be zero. E.g. the `cfg!` and `#[test]` macros often strip out code. If a macro is identified as causing a large increase in code size, it is worth |
