Skip to content

Remove LazyAttrTokenStream #127478

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

Closed

Conversation

nnethercote
Copy link
Contributor

r? @ghost

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 8, 2024
@nnethercote
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jul 8, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 8, 2024
…r=<try>

Remove `LazyAttrTokenStream`

r? `@ghost`
@bors
Copy link
Collaborator

bors commented Jul 8, 2024

⌛ Trying commit 1854d09 with merge cd61e8a...

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
#12 [ 5/11] RUN npm install [email protected] [email protected] -g
#12 4.797 npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
#12 4.865 npm WARN deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
#12 4.887 npm WARN deprecated [email protected]: Rimraf versions prior to v4 are no longer supported
#12 4.932 npm WARN deprecated @humanwhocodes/[email protected]: Use @eslint/config-array instead
#12 4.968 npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
#12 4.968 npm WARN deprecated [email protected]: Glob versions prior to v9 are no longer supported
#12 4.985 npm WARN deprecated @humanwhocodes/[email protected]: Use @eslint/object-schema instead
#12 5.930 added 205 packages in 6s
#12 5.930 
#12 5.930 20 packages are looking for funding
#12 5.930   run `npm fund` for details
---
#16 3.535 Building wheels for collected packages: reuse
#16 3.536   Building wheel for reuse (pyproject.toml): started
#16 3.870   Building wheel for reuse (pyproject.toml): finished with status 'done'
#16 3.871   Created wheel for reuse: filename=reuse-1.1.0-cp310-cp310-manylinux_2_35_x86_64.whl size=181117 sha256=f5f58750481f69515c2c0d1d503daf565e2565c370d07fc6aeb95fe3498b4269
#16 3.872   Stored in directory: /tmp/pip-ephem-wheel-cache-ekio05_t/wheels/c2/3c/b9/1120c2ab4bd82694f7e6f0537dc5b9a085c13e2c69a8d0c76d
#16 3.874 Installing collected packages: boolean-py, binaryornot, setuptools, reuse, python-debian, markupsafe, license-expression, jinja2, chardet
#16 3.897   Attempting uninstall: setuptools
#16 3.898     Found existing installation: setuptools 59.6.0
#16 3.899     Not uninstalling setuptools at /usr/lib/python3/dist-packages, outside environment /usr
---
     = note: required for `std::sync::Arc<std::vec::Vec<rustc_ast::tokenstream::AttrTokenTree>>` to implement `std::marker::Sync`
note: required because it appears within the type `rustc_ast::tokenstream::AttrTokenStream`
    --> /checkout/compiler/rustc_ast/src/tokenstream.rs:113:12
     |
113  | pub struct AttrTokenStream(pub Lrc<Vec<AttrTokenTree>>);
note: required because it appears within the type `rustc_ast::tokenstream::AttrTokenTree`
    --> /checkout/compiler/rustc_ast/src/tokenstream.rs:123:10
     |
123  | pub enum AttrTokenTree {
---
     |                   ^^^^^^
note: required because it appears within the type `std::vec::Vec<rustc_ast::tokenstream::AttrTokenTree>`
    --> /checkout/library/alloc/src/vec/mod.rs:398:12
     |
398  | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
     = note: required for `std::sync::Arc<std::vec::Vec<rustc_ast::tokenstream::AttrTokenTree>>` to implement `std::marker::Send`
note: required because it appears within the type `rustc_ast::tokenstream::AttrTokenStream`
    --> /checkout/compiler/rustc_ast/src/tokenstream.rs:113:12
     |
     |
113  | pub struct AttrTokenStream(pub Lrc<Vec<AttrTokenTree>>);
note: required because it appears within the type `std::option::Option<rustc_ast::tokenstream::AttrTokenStream>`
    --> /checkout/library/core/src/option.rs:574:10
     |
574  | pub enum Option<T> {
---
     |            ^^^^^^^^^^
note: required because it appears within the type `rustc_ast::Item`
    --> /checkout/compiler/rustc_ast/src/ast.rs:2972:12
     |
2972 | pub struct Item<K = ItemKind> {
     = note: required for `std::ptr::Unique<rustc_ast::Item>` to implement `std::marker::Send`
note: required because it appears within the type `std::boxed::Box<rustc_ast::Item>`
    --> /checkout/library/alloc/src/boxed.rs:238:12
     |
     |
238  | pub struct Box<
     |            ^^^
note: required because it appears within the type `rustc_ast::ptr::P<rustc_ast::Item>`
    --> /checkout/compiler/rustc_ast/src/ptr.rs:30:12
     |
30   | pub struct P<T: ?Sized> {
note: required because it appears within the type `rustc_ast::token::Nonterminal`
    --> /checkout/compiler/rustc_ast/src/token.rs:899:10
     |
899  | pub enum Nonterminal {
---
     |                   ^^^^^^
note: required because it appears within the type `std::vec::Vec<rustc_ast::tokenstream::TokenTree>`
    --> /checkout/library/alloc/src/vec/mod.rs:398:12
     |
398  | pub struct Vec<T, #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global> {
     = note: required for `std::sync::Arc<std::vec::Vec<rustc_ast::tokenstream::TokenTree>>` to implement `std::marker::Sync`
note: required because it appears within the type `rustc_ast::tokenstream::TokenStream`
    --> /checkout/compiler/rustc_ast/src/tokenstream.rs:236:12
     |
     |
236  | pub struct TokenStream(pub(crate) Lrc<Vec<TokenTree>>);
note: required because it appears within the type `rustc_ast::DelimArgs`
    --> /checkout/compiler/rustc_ast/src/ast.rs:1740:12
     |
1740 | pub struct DelimArgs {
---
     |            ^^^
note: required because it appears within the type `rustc_ast::ptr::P<rustc_ast::DelimArgs>`
    --> /checkout/compiler/rustc_ast/src/ptr.rs:30:12
     |
30   | pub struct P<T: ?Sized> {
note: required because it appears within the type `rustc_ast::MacCall`
    --> /checkout/compiler/rustc_ast/src/ast.rs:1656:12
     |
1656 | pub struct MacCall {
---
     |            ^^^
note: required because it appears within the type `rustc_ast::ptr::P<rustc_ast::MacCall>`
    --> /checkout/compiler/rustc_ast/src/ptr.rs:30:12
     |
30   | pub struct P<T: ?Sized> {
note: required because it appears within the type `rustc_ast::PatKind`
    --> /checkout/compiler/rustc_ast/src/ast.rs:775:10
     |
775  | pub enum PatKind {
---
     |            ^^^
note: required because it appears within the type `rustc_ast::ptr::P<rustc_ast::Pat>`
    --> /checkout/compiler/rustc_ast/src/ptr.rs:30:12
     |
30   | pub struct P<T: ?Sized> {
note: required because it appears within the type `rustc_ast::ExprKind`
    --> /checkout/compiler/rustc_ast/src/ast.rs:1401:10
     |
1401 | pub enum ExprKind {
---
     |            ^^^
note: required because it appears within the type `rustc_ast::ptr::P<rustc_ast::Expr>`
    --> /checkout/compiler/rustc_ast/src/ptr.rs:30:12
     |
30   | pub struct P<T: ?Sized> {
note: required because it appears within the type `rustc_ast::AnonConst`
    --> /checkout/compiler/rustc_ast/src/ast.rs:1166:12
     |
1166 | pub struct AnonConst {
---
     |            ^^^
note: required because it appears within the type `rustc_ast::ptr::P<rustc_ast::Ty>`
    --> /checkout/compiler/rustc_ast/src/ptr.rs:30:12
     |
30   | pub struct P<T: ?Sized> {
note: required because it appears within the type `rustc_ast::GenericArg`
    --> /checkout/compiler/rustc_ast/src/ast.rs:199:10
     |
199  | pub enum GenericArg {
---
     |            ^^^
note: required because it appears within the type `rustc_ast::ptr::P<rustc_ast::GenericArgs>`
    --> /checkout/compiler/rustc_ast/src/ptr.rs:30:12
     |
30   | pub struct P<T: ?Sized> {
note: required because it appears within the type `std::option::Option<rustc_ast::ptr::P<rustc_ast::GenericArgs>>`
    --> /checkout/library/core/src/option.rs:574:10
     |
574  | pub enum Option<T> {
---
     |            ^^^
note: required because it appears within the type `rustc_ast::ptr::P<rustc_ast::NormalAttr>`
    --> /checkout/compiler/rustc_ast/src/ptr.rs:30:12
     |
30   | pub struct P<T: ?Sized> {
note: required because it appears within the type `rustc_ast::AttrKind`
    --> /checkout/compiler/rustc_ast/src/ast.rs:2820:10
     |
2820 | pub enum AttrKind {
---
     = note: required for `thin_vec::ThinVec<rustc_ast::Attribute>` to implement `std::marker::Sync`
note: required because it appears within the type `rustc_ast::Item`
    --> /checkout/compiler/rustc_ast/src/ast.rs:2972:12
     |
2972 | pub struct Item<K = ItemKind> {
     = note: required for `std::ptr::Unique<rustc_ast::Item>` to implement `std::marker::Sync`
note: required because it appears within the type `std::boxed::Box<rustc_ast::Item>`
    --> /checkout/library/alloc/src/boxed.rs:238:12
     |
---
error: could not document `rustc_parse`
warning: build failed, waiting for other jobs to finish...


Command BootstrapCommand { command: cd "/checkout" && env -u MAKEFLAGS -u MFLAGS AR_x86_64_unknown_linux_gnu="ar" CARGO_INCREMENTAL="0" CARGO_PROFILE_RELEASE_DEBUG="0" CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS="true" CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS="true" CARGO_PROFILE_RELEASE_STRIP="false" CARGO_TARGET_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc" CC_x86_64_unknown_linux_gnu="sccache cc" CFG_COMPILER_BUILD_TRIPLE="x86_64-unknown-linux-gnu" CFG_COMPILER_HOST_TRIPLE="x86_64-unknown-linux-gnu" CFG_DEFAULT_CODEGEN_BACKEND="llvm" CFG_LIBDIR_RELATIVE="lib" CFG_RELEASE="1.81.0-nightly" CFG_RELEASE_CHANNEL="nightly" CFG_USE_SELF_CONTAINED_LINKER="1" CFG_VERSION="1.81.0-nightly (b2dcce979 2024-07-08)" CFG_VER_DATE="2024-07-08" CFG_VER_HASH="b2dcce9790440e22a4b32623b62dcf7c44e41dc4" CFLAGS_x86_64_unknown_linux_gnu="-ffunction-sections -fdata-sections -fPIC -m64" CXXFLAGS_x86_64_unknown_linux_gnu="-ffunction-sections -fdata-sections -fPIC -m64" CXX_x86_64_unknown_linux_gnu="sccache c++" LIBC_CHECK_CFG="1" LLVM_CONFIG="/checkout/obj/build/x86_64-unknown-linux-gnu/ci-llvm/bin/llvm-config" LLVM_LINK_SHARED="1" LLVM_NDEBUG="1" LLVM_RUSTLLVM="1" RANLIB_x86_64_unknown_linux_gnu="ar s" REAL_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" RUSTBUILD_NATIVE_DIR="/checkout/obj/build/x86_64-unknown-linux-gnu/native" RUSTC="/checkout/obj/build/bootstrap/debug/rustc" RUSTC_BOOTSTRAP="1" RUSTC_BREAK_ON_ICE="1" RUSTC_ERROR_METADATA_DST="/checkout/obj/build/tmp/extended-error-metadata" RUSTC_FORCE_UNSTABLE="1" RUSTC_HOST_FLAGS="--cfg=bootstrap -Zunstable-options --check-cfg=cfg(bootstrap)" RUSTC_INSTALL_BINDIR="bin" RUSTC_LIBDIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" RUSTC_LINT_FLAGS="-Wrust_2018_idioms -Wunused_lifetimes -Dwarnings" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" RUSTC_SNAPSHOT="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustc" RUSTC_SNAPSHOT_LIBDIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" RUSTC_STAGE="0" RUSTC_SYSROOT="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-sysroot" RUSTC_TLS_MODEL_INITIAL_EXEC="1" RUSTC_VERBOSE="0" RUSTC_VERIFY_LLVM_IR="1" RUSTC_WRAPPER="/checkout/obj/build/bootstrap/debug/rustc" RUSTDOC="/checkout/obj/build/bootstrap/debug/rustdoc" RUSTDOCFLAGS="--cfg=bootstrap --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options --check-cfg=cfg(bootstrap) --check-cfg=cfg(parallel_compiler) --document-private-items --document-hidden-items -Dwarnings -Wrustdoc::invalid_codeblock_attributes --crate-version 1.81.0-nightly\t(b2dcce979\t2024-07-08) --cfg=parallel_compiler --document-private-items -Arustdoc::private-intra-doc-links --enable-index-page -Zunstable-options -Znormalize-docs --show-type-layout -Zcrate-attr=warn(rust_2018_idioms) --extern-html-root-url ena=https://docs.rs/ena/latest/" RUSTDOC_LIBDIR="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/lib" RUSTDOC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustdoc" RUSTFLAGS="--cfg=bootstrap --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options --check-cfg=cfg(bootstrap) --check-cfg=cfg(parallel_compiler) -Zmacro-backtrace -Csplit-debuginfo=off -Zunstable-options -Wrustc::internal -Cprefer-dynamic --cfg=parallel_compiler -Clink-args=-Wl,-z,origin -Clink-args=-Wl,-rpath,$ORIGIN/../lib -Zon-broken-pipe=kill" RUST_TEST_THREADS="4" TERM="xterm" WINAPI_NO_BUNDLED_LIBRARIES="1" __CARGO_DEFAULT_LIB_METADATA="bootstrap" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "doc" "--target" "x86_64-unknown-linux-gnu" "--release" "-Zbinary-dep-depinfo" "-j" "4" "--locked" "--color" "always" "--features" "llvm rustc_use_parallel_compiler" "--manifest-path" "/checkout/compiler/rustc/Cargo.toml" "-Zunstable-options" "-Zskip-rustdoc-fingerprint" "--no-deps" "-Zrustdoc-map" "-p" "rustc-main" "-p" "rustc_abi" "-p" "rustc_arena" "-p" "rustc_ast" "-p" "rustc_ast_ir" "-p" "rustc_ast_lowering" "-p" "rustc_ast_passes" "-p" "rustc_ast_pretty" "-p" "rustc_attr" "-p" "rustc_baked_icu_data" "-p" "rustc_borrowck" "-p" "rustc_builtin_macros" "-p" "rustc_codegen_llvm" "-p" "rustc_codegen_ssa" "-p" "rustc_const_eval" "-p" "rustc_data_structures" "-p" "rustc_driver" "-p" "rustc_driver_impl" "-p" "rustc_error_codes" "-p" "rustc_error_messages" "-p" "rustc_errors" "-p" "rustc_expand" "-p" "rustc_feature" "-p" "rustc_fluent_macro" "-p" "rustc_fs_util" "-p" "rustc_graphviz" "-p" "rustc_hir" "-p" "rustc_hir_analysis" "-p" "rustc_hir_pretty" "-p" "rustc_hir_typeck" "-p" "rustc_incremental" "-p" "rustc_index" "-p" "rustc_index_macros" "-p" "rustc_infer" "-p" "rustc_interface" "-p" "rustc_lexer" "-p" "rustc_lint" "-p" "rustc_lint_defs" "-p" "rustc_llvm" "-p" "rustc_log" "-p" "rustc_macros" "-p" "rustc_metadata" "-p" "rustc_middle" "-p" "rustc_mir_build" "-p" "rustc_mir_dataflow" "-p" "rustc_mir_transform" "-p" "rustc_monomorphize" "-p" "rustc_next_trait_solver" "-p" "rustc_parse" "-p" "rustc_parse_format" "-p" "rustc_passes" "-p" "rustc_pattern_analysis" "-p" "rustc_privacy" "-p" "rustc_query_impl" "-p" "rustc_query_system" "-p" "rustc_resolve" "-p" "rustc_sanitizers" "-p" "rustc_serialize" "-p" "rustc_session" "-p" "rustc_smir" "-p" "rustc_span" "-p" "rustc_symbol_mangling" "-p" "rustc_target" "-p" "rustc_trait_selection" "-p" "rustc_traits" "-p" "rustc_transmute" "-p" "rustc_ty_utils" "-p" "rustc_type_ir" "-p" "rustc_type_ir_macros" "-p" "stable_mir", failure_behavior: Exit, stdout: Print, stderr: Print, run_always: false } did not execute successfully.

Build completed unsuccessfully in 0:00:34
  local time: Mon Jul  8 10:06:07 UTC 2024
  network time: Mon, 08 Jul 2024 10:06:07 GMT

@bors
Copy link
Collaborator

bors commented Jul 8, 2024

☀️ Try build successful - checks-actions
Build commit: cd61e8a (cd61e8ac84599b8978493f57a6fd8040c8324f04)

@nnethercote
Copy link
Contributor Author

@rust-timer build cd61e8a

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (cd61e8a): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.7% [0.3%, 1.5%] 40
Regressions ❌
(secondary)
1.3% [0.4%, 3.5%] 16
Improvements ✅
(primary)
-0.5% [-1.1%, -0.2%] 9
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 2
All ❌✅ (primary) 0.5% [-1.1%, 1.5%] 49

Max RSS (memory usage)

Results (primary -3.5%, secondary 9.6%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
12.6% [2.5%, 22.0%] 12
Improvements ✅
(primary)
-3.5% [-5.3%, -0.8%] 27
Improvements ✅
(secondary)
-8.5% [-9.3%, -7.8%] 2
All ❌✅ (primary) -3.5% [-5.3%, -0.8%] 27

Cycles

Results (primary 1.1%, secondary 3.6%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.1% [0.9%, 1.3%] 2
Regressions ❌
(secondary)
4.8% [2.0%, 6.9%] 5
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.5%, -2.5%] 1
All ❌✅ (primary) 1.1% [0.9%, 1.3%] 2

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 700.455s -> 707.239s (0.97%)
Artifact size: 328.61 MiB -> 328.93 MiB (0.10%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 9, 2024
@nnethercote nnethercote marked this pull request as draft July 10, 2024 06:05
@nnethercote
Copy link
Contributor Author

Hmm, even though this is a nice simplification the regression is a little larger than I'm willing to take.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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