Skip to content
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

Remove thread-local IGNORED_ATTRIBUTES. #98084

Merged

Conversation

nnethercote
Copy link
Contributor

It's just a copy of the read-only global ich::IGNORED_ATTRIBUTES, and
can be removed without any effect.

r? @michaelwoerister

It's just a copy of the read-only global `ich::IGNORED_ATTRIBUTES`, and
can be removed without any effect.
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 14, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 14, 2022
@nnethercote
Copy link
Contributor Author

@bors rollup=always

@michaelwoerister
Copy link
Member

Thanks, @nnethercote! That was probably meant as on optimization (HashMap vs linear list lookup). But if it doesn't affect performance, let's remove it.

@bors r+

@bors
Copy link
Contributor

bors commented Jun 14, 2022

📌 Commit a280162 has been approved by michaelwoerister

@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 Jun 14, 2022
static IGNORED_ATTRIBUTES: FxHashSet<Symbol> = compute_ignored_attr_names();
}
IGNORED_ATTRIBUTES.with(|attrs| attrs.contains(&name))
ich::IGNORED_ATTRIBUTES.contains(&name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously this would do a HashSet lookup in O(1). Now it does a Vec search in O(n).

@michaelwoerister
Copy link
Member

Previously this would do a HashSet lookup in O(1). Now it does a Vec search in O(n).

Let's make sure we get a clean perf run for this, so we can revert if necessary:
@bors rollup=never

We could also consider using a lazy static hashmap here.

@bors
Copy link
Contributor

bors commented Jun 14, 2022

⌛ Testing commit a280162 with merge 8beb2bd30e3ef75759d48d465c57aae0893d02ae...

@bors
Copy link
Contributor

bors commented Jun 14, 2022

💔 Test failed - checks-actions

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

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools-bin/miri" "--edition" "2018" "-Astable-features" "--sysroot" "/home/user/.cache/miri/HOST" "-Zui-testing" "tests/pass/threadleak_ignored.rs" "--error-format=json" "-Zmiri-ignore-leaks"

Pass got exit status: 1

actual output differed from expected tests/pass/threadleak_ignored.stderr
Diff < left / right > :
<Dropping 0
>error: Undefined Behavior: deallocating while item is protected: [SharedReadWrite for <TAG> (call ID)]
>  --> RUSTLIB/alloc/src/alloc.rs:LL:CC
>   |
>LL |     unsafe { __rust_dealloc(ptr, layout.size(), layout.align()) }
>   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ deallocating while item is protected: [SharedReadWrite for <TAG> (call ID)]
>   |
>   = help: this indicates a potential bug in the program: it performed an invalid operation, but the Stacked Borrows rules it violated are still experimental
>           
>   = note: inside `std::alloc::dealloc` at RUSTLIB/alloc/src/alloc.rs:LL:CC
>   = note: inside `<std::alloc::Global as std::alloc::Allocator>::deallocate` at RUSTLIB/alloc/src/alloc.rs:LL:CC
>   = note: inside `<std::sync::Weak<std::sync::mpsc::blocking::Inner> as std::ops::Drop>::drop` at RUSTLIB/alloc/src/sync.rs:LL:CC
>   = note: inside `<std::sync::Weak<std::sync::mpsc::blocking::Inner> as std::ops::Drop>::drop` at RUSTLIB/alloc/src/sync.rs:LL:CC
>   = note: inside `std::ptr::drop_in_place::<std::sync::Weak<std::sync::mpsc::blocking::Inner>> - shim(Some(std::sync::Weak<std::sync::mpsc::blocking::Inner>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
>   = note: inside `std::mem::drop::<std::sync::Weak<std::sync::mpsc::blocking::Inner>>` at RUSTLIB/core/src/mem/mod.rs:LL:CC
>   = note: inside `std::sync::Arc::<std::sync::mpsc::blocking::Inner>::drop_slow` at RUSTLIB/alloc/src/sync.rs:LL:CC
>   = note: inside `<std::sync::Arc<std::sync::mpsc::blocking::Inner> as std::ops::Drop>::drop` at RUSTLIB/alloc/src/sync.rs:LL:CC
>   = note: inside `std::ptr::drop_in_place::<std::sync::Arc<std::sync::mpsc::blocking::Inner>> - shim(Some(std::sync::Arc<std::sync::mpsc::blocking::Inner>))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
>   = note: inside `std::ptr::drop_in_place::<std::sync::mpsc::blocking::SignalToken> - shim(Some(std::sync::mpsc::blocking::SignalToken))` at RUSTLIB/core/src/ptr/mod.rs:LL:CC
>   = note: inside `std::sync::mpsc::oneshot::Packet::<()>::send` at RUSTLIB/std/src/sync/mpsc/oneshot.rs:LL:CC
>   = note: inside `std::sync::mpsc::Sender::<()>::send` at RUSTLIB/std/src/sync/mpsc/mod.rs:LL:CC
>  --> $DIR/threadleak_ignored.rs:LL:CC
>   |
>   |
>LL |         send.send(()).unwrap();
>   |         ^^^^^^^^^^^^^
>note: some details are omitted, run with `MIRIFLAGS=-Zmiri-backtrace=full` for a verbose backtrace
>
>error: aborting due to previous error
>
>
 



There were 1 unmatched diagnostics that occurred outside the testfile and had not pattern
    Error: Undefined Behavior: deallocating while item is protected: [SharedReadWrite for <10981> (call 3269)]
failures:
    tests/pass/threadleak_ignored.rs

test result: FAIL. 1 tests failed, 232 tests passed, 1 ignored, 0 filtered out
---
.......... (60/64)
...       (64/64)


/checkout/src/test/rustdoc-gui/search-filter.goml search-filter... FAILED
[ERROR] (line 6) Error: The following CSS selector "#titles" was not found: for command `wait-for: "#titles"`
Build completed unsuccessfully in 0:00:46

@nnethercote
Copy link
Contributor Author

@bors retry

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

Let's do a perf run ahead of time.

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 14, 2022
@nnethercote
Copy link
Contributor Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 14, 2022
@bors
Copy link
Contributor

bors commented Jun 14, 2022

⌛ Trying commit a280162 with merge 749b0e41927602c22d2cd581e99f43f94176e549...

@bors
Copy link
Contributor

bors commented Jun 15, 2022

☀️ Try build successful - checks-actions
Build commit: 749b0e41927602c22d2cd581e99f43f94176e549 (749b0e41927602c22d2cd581e99f43f94176e549)

@rust-timer
Copy link
Collaborator

Queued 749b0e41927602c22d2cd581e99f43f94176e549 with parent 1f34da9, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (749b0e41927602c22d2cd581e99f43f94176e549): comparison url.

Instruction count

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

Max RSS (memory usage)

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
4.1% 4.1% 1
Improvements 🎉
(primary)
-0.8% -0.8% 1
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) -0.8% -0.8% 1

Cycles

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: 🎉 relevant improvement found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-1.5% -1.5% 1
Improvements 🎉
(secondary)
-2.5% -2.5% 1
All 😿🎉 (primary) -1.5% -1.5% 1

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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.

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

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jun 15, 2022
@nnethercote
Copy link
Contributor Author

Perf results are neutral.

@bors r=michaelwoerister

@bors
Copy link
Contributor

bors commented Jun 15, 2022

📌 Commit a280162 has been approved by michaelwoerister

@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. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 15, 2022
@bors
Copy link
Contributor

bors commented Jun 15, 2022

⌛ Testing commit a280162 with merge ebe184a...

@bors
Copy link
Contributor

bors commented Jun 15, 2022

☀️ Test successful - checks-actions
Approved by: michaelwoerister
Pushing ebe184a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 15, 2022
@bors bors merged commit ebe184a into rust-lang:master Jun 15, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 15, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ebe184a): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regression found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
0.6% 0.6% 1
Regressions 😿
(secondary)
0.9% 0.9% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 0.6% 0.6% 1

Max RSS (memory usage)

Results
  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
4.2% 4.2% 1
Improvements 🎉
(primary)
-0.7% -0.7% 1
Improvements 🎉
(secondary)
-3.8% -4.0% 2
All 😿🎉 (primary) -0.7% -0.7% 1

Cycles

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 😿 relevant regression found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
2.1% 2.1% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) N/A N/A 0

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@nnethercote nnethercote deleted the rm-thread-local-IGNORED_ATTRIBUTES branch June 16, 2022 00:24
@nnethercote
Copy link
Contributor Author

The previous perf run was neutral. The post-merging one had two regressions, but I am confident they're just noise. A real regression would show up more consistently, e.g. multiple regressions on a single benchmark.

@rustbot perf-regression-triaged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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.

8 participants