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

runtime: severe performance drop for cgo calls in go1.22.5 [1.23 backport] #69988

Open
gopherbot opened this issue Oct 22, 2024 · 4 comments
Open
Labels
CherryPickCandidate Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Milestone

Comments

@gopherbot
Copy link
Contributor

@aclements requested issue #68587 to be considered for backport to the next 1.23 minor release.

@gopherbot , please open a backport to 1.23.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Oct 22, 2024
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Oct 22, 2024
@gopherbot gopherbot added this to the Go1.23.3 milestone Oct 22, 2024
@aclements
Copy link
Member

This causes a dramatic drop in C -> Go call performance under some circumstances.

@Arup-Chauhan
Copy link

Hi @aclements, I wanted to work, this can be a potential workaround.

// Workaround: Use `runtime.LockOSThread()` to minimize thread switching overhead.
// This ensures the goroutine stays on the same OS thread during C -> Go calls.
runtime.LockOSThread()
defer runtime.UnlockOSThread()


Would this be viable? Feedback appreciated.

@arl
Copy link
Contributor

arl commented Oct 26, 2024

@Arup-Chauhan the problem has already been worked on, the changes should be in next go release and also backported to go1.23. In fact, we're on the backporting issue here.
See #68587

@Arup-Chauhan
Copy link

Thankyou for the update @arl , I will try to contribute to some other issue then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickCandidate Used during the release process for point releases compiler/runtime Issues related to the Go compiler and/or runtime.
Projects
None yet
Development

No branches or pull requests

4 participants