-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Use a more efficient Once
on platforms without threads
#105698
Conversation
r? @thomcc (rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Sure, this seems fine. Sorry for the delay @bors r+ |
Does this use the existing multi-threaded |
Yes exactly. It shares the futex-based implementation also used by Linux. |
☀️ Test successful - checks-actions |
Finished benchmarking commit (7ab8038): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDNext Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis 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.
|
This is common noise on these benchmarks: the opposite of the previous commit's improvements. @rustbot label: +perf-regression-triaged |
…homcc Use a more efficient `Once` on platforms without threads The current implementation uses an atomic queue and spins rather than panicking when calling `call_once` recursively. Since concurrency is not supported on platforms like WASM, `Once` can be implemented much more efficiently using just a single non-atomic state variable.
The current implementation uses an atomic queue and spins rather than panicking when calling
call_once
recursively. Since concurrency is not supported on platforms like WASM,Once
can be implemented much more efficiently using just a single non-atomic state variable.