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

[SR-10856] Random Performance #53246

Open
swift-ci opened this issue Jun 7, 2019 · 3 comments
Open

[SR-10856] Random Performance #53246

swift-ci opened this issue Jun 7, 2019 · 3 comments
Labels
improvement standard library Area: Standard library umbrella

Comments

@swift-ci
Copy link
Collaborator

swift-ci commented Jun 7, 2019

Previous ID SR-10856
Radar None
Original Reporter robp (JIRA User)
Type Improvement

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Improvement
Assignee None
Priority Medium

md5: 053d86c49d7db04030d5556413da9124

Issue Description:

Random performance can be improved on Apple platforms by bit-shifting two UInt32 from arc4random versus a more expensive arc4random_buf. It is unclear how to best make this change considering ABI stability.

To root implementation is contained within swift/stdlib/public/stubs/Random.cpp. Other relevant files are swift/stdlib/public/SwiftShims/LibcShims.h and swift/stdlib/public/core/Random.swift.

@belkadan
Copy link
Contributor

cc @stephentyrone

@stephentyrone
Copy link
Member

If this is the case, it's a bug to be fixed in the OS, not something that we should be hacking around in Swift. robp (JIRA User) what hardware and OS version are you observing this on? I haven't been able to reproduce it in initial testing.

@stephentyrone
Copy link
Member

Doing a little bit of archaeology, I believe that this may have been fixed in the OS in iOS 13.0 / macOS 10.15, etc, which would explain why I'm not seeing a problem in my tests.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants