Skip to content

Use native tls model in macos for better performance #55576

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

Merged
merged 5 commits into from
Aug 28, 2024
Merged

Conversation

gbaraldi
Copy link
Member

Macos has a native tls implementation in clang since at least clang 3.7 which much older than what we require so lets enable it for some small performance gains.

We may want to turn on the ifunc optimization that's there as well but I haven't tested it and it's only in clang 18 and up so it would be off for most since Apple clang is 16 on their latest beta llvm/llvm-project#73687

@gbaraldi gbaraldi requested a review from vtjnash August 23, 2024 22:07
@giordano giordano added system:mac Affects only macOS multithreading Base.Threads and related functionality labels Aug 23, 2024
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

I thought we had deleted all this cruft a couple versions ago. Isn't it all just empty definitions we left around to satisfy the header API?

@gbaraldi
Copy link
Member Author

gbaraldi commented Aug 24, 2024

Nope. Any time we do a tls lookup we go through these. And while swiftcc stuff helps with julia code it doesn't with C code. (The big place where I was seeing it was setting the gcstack in a task switch)

@gbaraldi gbaraldi added the merge me PR is reviewed. Merge when all tests are passing label Aug 27, 2024
@giordano giordano merged commit d882d62 into master Aug 28, 2024
8 checks passed
@giordano giordano deleted the gb/native-tls branch August 28, 2024 07:22
@giordano giordano removed the merge me PR is reviewed. Merge when all tests are passing label Aug 28, 2024
KristofferC pushed a commit that referenced this pull request Sep 12, 2024
Macos has a native tls implementation in clang since at least clang 3.7
which much older than what we require so lets enable it for some small
performance gains.

We may want to turn on the ifunc optimization that's there as well but I
haven't tested it and it's only in clang 18 and up so it would be off
for most since Apple clang is 16 on their latest beta
llvm/llvm-project#73687
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
multithreading Base.Threads and related functionality system:mac Affects only macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants