Skip to content

Remove the Arc rt::init allocation for thread info#123550

Merged
bors merged 1 commit intorust-lang:masterfrom
GnomedDev:remove-initial-arc
Oct 24, 2024
Merged

Remove the Arc rt::init allocation for thread info#123550
bors merged 1 commit intorust-lang:masterfrom
GnomedDev:remove-initial-arc

Conversation

@GnomedDev
Copy link
Contributor

@GnomedDev GnomedDev commented Apr 6, 2024

Removes an allocation pre-main by just not storing anything in std::thread::Thread for the main thread.

  • The thread name can just be a hard coded literal, as was done in Remove rt::init allocation for thread name #123433.
  • Storing ThreadId and Parker in a static that is initialized once at startup. This uses SyncUnsafeCell and MaybeUninit as this is quite performance critical and we don't need synchronization or to store a tag value and possibly leave in a panic.

@rustbot
Copy link
Collaborator

rustbot commented Apr 6, 2024

r? @Nilstrieb

rustbot has assigned @Nilstrieb.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

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

I just checked and Option<Pin<Arc<T>>> does indeed niche, so this doesn't grow the size of std::thread::Thread.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@GnomedDev GnomedDev force-pushed the remove-initial-arc branch from d5a081b to d5b8b00 Compare April 6, 2024 14:27
@saethlin
Copy link
Member

saethlin commented Apr 6, 2024

@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 Apr 6, 2024
@bors
Copy link
Collaborator

bors commented Apr 6, 2024

⌛ Trying commit d5b8b00 with merge 666bbff...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 6, 2024
Remove last rt::init allocation for thread info

Removes the last allocation pre-main by just not storing anything in std::thread::Thread for the main thread.
- The thread name can just be a hard coded literal, as was done in rust-lang#123433.
- The ThreadId is always the `1` value, so `ThreadId::new` now starts at `2` and can fabricate the `1` value when needed.
- Storing Parker in a static that is initialized once at startup. This uses SyncUnsafeCell and MaybeUninit as this is quite performance critical and we don't need synchronization or to store a tag value and possibly leave in a panic.

This currently does not have a regression test to prevent future changes from re-adding allocations pre-main as I'm [having trouble](GnomedDev@6f7be53) implementing it, but if wanted I can draft this PR until that test is ready.
@bors
Copy link
Collaborator

bors commented Apr 6, 2024

☀️ Try build successful - checks-actions
Build commit: 666bbff (666bbff29cc26856cc869d4b7e16f6843b105c4b)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (666bbff): comparison URL.

Overall result: ❌ regressions - no 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.

@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.4% [0.4%, 0.4%] 1
Regressions ❌
(secondary)
1.5% [1.5%, 1.5%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.4% [0.4%, 0.4%] 1

Max RSS (memory usage)

Results

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)
4.0% [2.6%, 5.2%] 3
Regressions ❌
(secondary)
4.3% [2.9%, 6.7%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 4.0% [2.6%, 5.2%] 3

Cycles

Results

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)
1.8% [1.4%, 2.2%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) - - 0

Binary size

Results

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.1% [0.0%, 0.1%] 23
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 35
Improvements ✅
(primary)
-0.1% [-0.3%, -0.0%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-0.3%, 0.1%] 25

Bootstrap: 666.761s -> 666.789s (0.00%)
Artifact size: 318.27 MiB -> 318.23 MiB (-0.01%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 6, 2024
Copy link
Member

@Noratrieb Noratrieb left a comment

Choose a reason for hiding this comment

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

I don't love the increased complexity and unsafety.. if you have some good justification for why this is important that would be great, but I'm inclined to accept it even without that, it certainly feels good to have this property.

@GnomedDev
Copy link
Contributor Author

The increased complexity is a bit sad, but this is already a complex and unsafe process to initialise the basics for the runtime, so I felt that the increased performance and decreased compile time was worth a small amount of well documented unsafety.

@GnomedDev
Copy link
Contributor Author

Hmm, looking at the actual perf run, it seems quite negative which is certainly unexpected. How is this commonly debugged, as I don't want to go off vibes?

@Noratrieb
Copy link
Member

Run the cachegrind command to see where in the compiler the diff occurs. Though FWIW, I would expect these results to be noise and wouldn't chase them further myself - I'd just treat it as "makes no difference".

@Noratrieb
Copy link
Member

Noratrieb commented Apr 6, 2024

that the increased performance and decreased compile time

so yeah, no real decreased compile time. as for increased performance, I doubt that this will be measurable, maybe fn main() {} (which is a pretty useless program). If you have a benchmark where this helps that would be great to have.

@GnomedDev
Copy link
Contributor Author

Okay, I don't have a benchmark (I never have a benchmark). Would you like me to rewrite this using OnceLock, just to see if that perf run is also neutral?

@GnomedDev GnomedDev force-pushed the remove-initial-arc branch 2 times, most recently from 778330b to ab8eba1 Compare April 7, 2024 11:17
@GnomedDev
Copy link
Contributor Author

Sorted the existing review comments, just waiting on a reply to my last comment.

@bors
Copy link
Collaborator

bors commented Apr 14, 2024

☔ The latest upstream changes (presumably #123913) made this pull request unmergeable. Please resolve the merge conflicts.

@GnomedDev GnomedDev force-pushed the remove-initial-arc branch from ab8eba1 to 2c45b39 Compare April 14, 2024 14:59
@GnomedDev
Copy link
Contributor Author

Okay, @Nilstrieb I've been trying for the last week different ways to make this less unsafe and complex but it doesn't seem possible with the "Parker must be initialized in place" requirement. I cannot initialize a OnceLock or an Option in-place without increasing complexity significantly, so this seems like the least complex (and most performant) way to do this.

Copy link
Member

@Noratrieb Noratrieb left a comment

Choose a reason for hiding this comment

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

thanks! i can't think of a way to make this nicer, it's good enough now i think

/// The internal representation of a `Thread` handle
struct Inner {
name: ThreadName, // Guaranteed to be UTF-8
static MAIN_THREAD_INFO: SyncUnsafeCell<(MaybeUninit<ThreadId>, MaybeUninit<Parker>)> =
Copy link
Member

Choose a reason for hiding this comment

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

we could now move this into new_main, but I really don't want to continue letting you suffer with this so we'll leave it as-is

@Noratrieb
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

bors commented Oct 23, 2024

📌 Commit 0747f28 has been approved by Noratrieb

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Oct 24, 2024

⌛ Testing commit 0747f28 with merge 22b94c7...

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
---- [run-make] tests\run-make\avr-rjmp-offset stdout ----

error: rmake recipe failed to complete
status: exit code: 1
command: "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\avr-rjmp-offset\\rmake.exe"
--- stderr -------------------------------
command failed at line 29
command failed at line 29
Command { cmd: "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\bin\\rustc.exe" "-L" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\avr-rjmp-offset\\rmake_out" "avr-rjmp-offsets.rs" "-Copt-level=s" "-Cpanic=abort" "--target=avr-unknown-gnu-atmega328" "-Clinker=rust-lld" "-Clink-arg=--entry=main" "-o" "compiled", stdin_buf: None, stdin: None, stdout: None, stderr: None, drop_bomb: DropBomb { command: "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage2\\bin\\rustc.exe", defused: true, armed_location: Location { file: "C:\\a\\rust\\rust\\tests\\run-make\\avr-rjmp-offset\\rmake.rs", line: 16, col: 5 } }, already_executed: true }
output status: `exit code: 1`
=== STDOUT ===


=== STDERR ===
error: linking with `rust-lld` failed: exit code: 0xc0000005
error: linking with `rust-lld` failed: exit code: 0xc0000005
  |
  = note: "rust-lld" "-flavor" "gnu" "C:\\a\\_temp\\msys64\\tmp\\rustc2fOg1x\\symbols.o" "compiled.avr_rjmp_offsets.ab053966543a1f9f-cgu.0.rcgu.o" "--as-needed" "-Bdynamic" "-z" "noexecstack" "-L" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\avr-rjmp-offset\\rmake_out" "-o" "compiled" "--gc-sections" "--entry=main"
  = note: PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.␍
          Exception Code: 0xC0000005␍
          0x00007FFFE67B784C, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFFE67A0000) + 0x1784C byte(s), RtlEnterCriticalSection() + 0x3CC byte(s)␍
          0x00007FFFE67BB550, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFFE67A0000) + 0x1B550 byte(s), RtlGetCurrentServiceSessionId() + 0xBF0 byte(s)␍
          0x00007FFFE67BA8C1, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFFE67A0000) + 0x1A8C1 byte(s), RtlFreeHeap() + 0x51 byte(s)␍
          0x00007FFFE48AC69C, C:\Windows\System32\msvcrt.dll(0x00007FFFE4890000) + 0x1C69C byte(s), free() + 0x1C byte(s)␍
          0x00007FFFE1F24AF1, C:\a\rust\rust\mingw64\bin\libwinpthread-1.dll(0x00007FFFE1F20000) + 0x4AF1 byte(s), pthread_tls_init() + 0x701 byte(s)␍
          0x00007FFFE1F24C15, C:\a\rust\rust\mingw64\bin\libwinpthread-1.dll(0x00007FFFE1F20000) + 0x4C15 byte(s), pthread_create_wrapper() + 0xC5 byte(s)␍
          0x00007FFFE48CDFD4, C:\Windows\System32\msvcrt.dll(0x00007FFFE4890000) + 0x3DFD4 byte(s), _beginthreadex() + 0x134 byte(s)␍
          0x00007FFFE48CE0AC, C:\Windows\System32\msvcrt.dll(0x00007FFFE4890000) + 0x3E0AC byte(s), _endthreadex() + 0xAC byte(s)␍
          0x00007FFFE4E94CB0, C:\Windows\System32\KERNEL32.DLL(0x00007FFFE4E80000) + 0x14CB0 byte(s), BaseThreadInitThunk() + 0x10 byte(s)␍
          0x00007FFFE681ECDB, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFFE67A0000) + 0x7ECDB byte(s), RtlUserThreadStart() + 0x2B byte(s)␍

error: aborting due to 1 previous error
------------------------------------------

@bors
Copy link
Collaborator

bors commented Oct 24, 2024

💔 Test failed - checks-actions

@Noratrieb
Copy link
Member

no @bors retry

@klensy
Copy link
Contributor

klensy commented Oct 24, 2024

"PLEASE submit a bug report to" wow, lld crashed.

@bors
Copy link
Collaborator

bors commented Oct 24, 2024

⌛ Testing commit 0747f28 with merge e22b73c...

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
[RUSTC-TIMING] clap_builder test:false 60.213
   Compiling clap v4.5.18
[RUSTC-TIMING] clap test:false 0.053
   Compiling color-print-proc-macro v0.3.6
rustc: /checkout/src/llvm-project/llvm/include/llvm/ADT/DenseMap.h:665: bool llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::LookupBucketFor(const LookupKeyT&, const BucketT*&) const [with LookupKeyT = unsigned int; DerivedT = llvm::DenseMap<unsigned int, unsigned int, llvm::DenseMapInfo<unsigned int>, llvm::detail::DenseMapPair<unsigned int, unsigned int> >; KeyT = unsigned int; ValueT = unsigned int; KeyInfoT = llvm::DenseMapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned int, unsigned int>]: Assertion `!KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) && "Empty/Tombstone value shouldn't be inserted into map!"' failed.
[RUSTC-TIMING] gix_odb test:false 26.101
rustc exited with signal: 6 (SIGABRT) (core dumped)
error: could not compile `gix-odb` (lib)
Caused by:
Caused by:
  process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc /checkout/obj/build/bootstrap/debug/rustc --crate-name gix_odb --edition=2021 /cargo/registry/src/index.crates.io-1cd66030c949c28d/gix-odb-0.61.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debug-assertions=on --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("document-features", "serde"))' -C metadata=a511bd68e2e20b59 -C extra-filename=-a511bd68e2e20b59 --out-dir /checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps --target i686-unknown-linux-gnu -L dependency=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/release/deps --extern arc_swap=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps/libarc_swap-c1acb957ef720cf1.rmeta --extern gix_date=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps/libgix_date-2c8fab11200eb82a.rmeta --extern gix_features=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps/libgix_features-e8853d3c715ddc2b.rmeta --extern gix_fs=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps/libgix_fs-e207a4f8f2b05415.rmeta --extern gix_hash=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps/libgix_hash-d82312cbff3f42e5.rmeta --extern gix_object=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps/libgix_object-4239355b4f07d172.rmeta --extern gix_pack=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps/libgix_pack-d72d5dc3237cd702.rmeta --extern gix_path=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps/libgix_path-1b16855d79a70231.rmeta --extern gix_quote=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps/libgix_quote-8619429af4d52921.rmeta --extern parking_lot=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps/libparking_lot-b5baa6d730ec26ac.rmeta --extern tempfile=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps/libtempfile-e435e31b6ba01628.rmeta --extern thiserror=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/deps/libthiserror-9a599bfcd0e93160.rmeta --cap-lints allow --cfg=windows_raw_dylib -Csymbol-mangling-version=v0 -Zunstable-options '--check-cfg=cfg(bootstrap)' '--check-cfg=cfg(llvm_enzyme)' '--check-cfg=cfg(parallel_compiler)' '--check-cfg=cfg(rust_analyzer)' -Zmacro-backtrace -Csplit-debuginfo=off --cfg=parallel_compiler -Clink-args=-Wl,-z,origin '-Clink-args=-Wl,-rpath,$ORIGIN/../lib' -Zunstable-options -Z binary-dep-depinfo -L native=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/build/libz-sys-9a975afd640e0171/out/lib -L native=/checkout/obj/build/i686-unknown-linux-gnu/stage1-tools/i686-unknown-linux-gnu/release/build/libz-sys-9a975afd640e0171/out/lib` (exit status: 254)
[RUSTC-TIMING] color_print_proc_macro test:false 3.022
[RUSTC-TIMING] tracing_subscriber test:false 20.017
[RUSTC-TIMING] gix_dir test:false 5.393
[RUSTC-TIMING] gix_submodule test:false 6.849

@bors
Copy link
Collaborator

bors commented Oct 24, 2024

💔 Test failed - checks-actions

@Noratrieb
Copy link
Member

please stop dying
@bors retry

@klensy
Copy link
Contributor

klensy commented Oct 24, 2024

Previous:

Details
2024-10-24T03:22:49.8907156Z error: linking with `rust-lld` failed: exit code: 0xc0000005
2024-10-24T03:22:49.8907587Z   |
2024-10-24T03:22:49.8909276Z   = note: "rust-lld" "-flavor" "gnu" "C:\\a\\_temp\\msys64\\tmp\\rustc2fOg1x\\symbols.o" "compiled.avr_rjmp_offsets.ab053966543a1f9f-cgu.0.rcgu.o" "--as-needed" "-Bdynamic" "-z" "noexecstack" "-L" "C:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\test\\run-make\\avr-rjmp-offset\\rmake_out" "-o" "compiled" "--gc-sections" "--entry=main"
2024-10-24T03:22:49.8916624Z   = note: PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.␍
2024-10-24T03:22:49.8918113Z           Exception Code: 0xC0000005␍
2024-10-24T03:22:49.8919000Z           0x00007FFFE67B784C, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFFE67A0000) + 0x1784C byte(s), RtlEnterCriticalSection() + 0x3CC byte(s)␍
2024-10-24T03:22:49.8920295Z           0x00007FFFE67BB550, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFFE67A0000) + 0x1B550 byte(s), RtlGetCurrentServiceSessionId() + 0xBF0 byte(s)␍
2024-10-24T03:22:49.8921662Z           0x00007FFFE67BA8C1, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFFE67A0000) + 0x1A8C1 byte(s), RtlFreeHeap() + 0x51 byte(s)␍
2024-10-24T03:22:49.8922774Z           0x00007FFFE48AC69C, C:\Windows\System32\msvcrt.dll(0x00007FFFE4890000) + 0x1C69C byte(s), free() + 0x1C byte(s)␍
2024-10-24T03:22:49.8924039Z           0x00007FFFE1F24AF1, C:\a\rust\rust\mingw64\bin\libwinpthread-1.dll(0x00007FFFE1F20000) + 0x4AF1 byte(s), pthread_tls_init() + 0x701 byte(s)␍
2024-10-24T03:22:49.8925438Z           0x00007FFFE1F24C15, C:\a\rust\rust\mingw64\bin\libwinpthread-1.dll(0x00007FFFE1F20000) + 0x4C15 byte(s), pthread_create_wrapper() + 0xC5 byte(s)␍
2024-10-24T03:22:49.8926760Z           0x00007FFFE48CDFD4, C:\Windows\System32\msvcrt.dll(0x00007FFFE4890000) + 0x3DFD4 byte(s), _beginthreadex() + 0x134 byte(s)␍
2024-10-24T03:22:49.8927919Z           0x00007FFFE48CE0AC, C:\Windows\System32\msvcrt.dll(0x00007FFFE4890000) + 0x3E0AC byte(s), _endthreadex() + 0xAC byte(s)␍
2024-10-24T03:22:49.8929103Z           0x00007FFFE4E94CB0, C:\Windows\System32\KERNEL32.DLL(0x00007FFFE4E80000) + 0x14CB0 byte(s), BaseThreadInitThunk() + 0x10 byte(s)␍
2024-10-24T03:22:49.8930300Z           0x00007FFFE681ECDB, C:\Windows\SYSTEM32\ntdll.dll(0x00007FFFE67A0000) + 0x7ECDB byte(s), RtlUserThreadStart() + 0x2B byte(s)␍
2024-10-24T03:22:49.8931030Z           
2024-10-24T03:22:49.8931178Z 
2024-10-24T03:22:49.8931367Z error: aborting due to 1 previous error
2024-10-24T03:22:49.8931819Z ------------------------------------------
2024-10-24T03:22:49.8932087Z 
2024-10-24T03:22:49.8932093Z 
2024-10-24T03:22:49.8932099Z 
2024-10-24T03:22:49.8932191Z failures:
2024-10-24T03:22:49.8932535Z     [run-make] tests\run-make\avr-rjmp-offset

This looks like legitimate error:

2024-10-24T10:14:12.2067196Z rustc: /checkout/src/llvm-project/llvm/include/llvm/ADT/DenseMap.h:665: bool llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::LookupBucketFor(const LookupKeyT&, const BucketT*&) const [with LookupKeyT = unsigned int; DerivedT = llvm::DenseMap<unsigned int, unsigned int, llvm::DenseMapInfo<unsigned int>, llvm::detail::DenseMapPair<unsigned int, unsigned int> >; KeyT = unsigned int; ValueT = unsigned int; KeyInfoT = llvm::DenseMapInfo<unsigned int>; BucketT = llvm::detail::DenseMapPair<unsigned int, unsigned int>]: Assertion `!KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) && "Empty/Tombstone value shouldn't be inserted into map!"' failed.
2024-10-24T10:14:12.4649427Z [RUSTC-TIMING] gix_odb test:false 26.101
2024-10-24T10:14:12.4657625Z rustc exited with signal: 6 (SIGABRT) (core dumped)

Weird.

@bors
Copy link
Collaborator

bors commented Oct 24, 2024

⌛ Testing commit 0747f28 with merge f61306d...

@bors
Copy link
Collaborator

bors commented Oct 24, 2024

☀️ Test successful - checks-actions
Approved by: Noratrieb
Pushing f61306d to master...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f61306d): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

mean range count
Regressions ❌
(primary)
0.1% [0.1%, 0.2%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.1%, 0.2%] 2

Max RSS (memory usage)

Results (primary -0.3%)

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)
2.9% [1.2%, 4.6%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.5% [-4.7%, -2.2%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.3% [-4.7%, 4.6%] 4

Cycles

Results (secondary -2.1%)

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)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.1% [-2.1%, -2.1%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, secondary 0.0%)

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.1% [0.0%, 0.1%] 19
Regressions ❌
(secondary)
0.0% [0.0%, 0.0%] 35
Improvements ✅
(primary)
-0.1% [-0.3%, -0.0%] 7
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-0.3%, 0.1%] 26

Bootstrap: 780.805s -> 780.742s (-0.01%)
Artifact size: 333.57 MiB -> 333.58 MiB (0.00%)

#[derive(Clone)]
enum Inner {
/// Represents the main thread. May only be constructed by Thread::new_main.
Main(&'static (ThreadId, Parker)),
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that the main thread is a static reference, why not just have this be an Option<Pin<Arc<OtherInner>>>? Every None match can refer to the static.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.