Skip to content

perf(driverbase): safeguard against goroutine spam#118

Merged
lidavidm merged 1 commit intomainfrom
perf
Feb 2, 2026
Merged

perf(driverbase): safeguard against goroutine spam#118
lidavidm merged 1 commit intomainfrom
perf

Conversation

@lidavidm
Copy link
Copy Markdown
Contributor

What's Changed

ADBC drivers are mostly built into shared libraries and used that way. When C code calls Go code, the Go runtime will lock the goroutine to a thread. If the Go code then spawns a lot of goroutines from that thread, this will thrash the scheduler as the current thread can't be used.

ADBC drivers are mostly built into shared libraries and used
that way. When C code calls Go code, the Go runtime will lock
the goroutine to a thread. If the Go code then spawns a lot of
goroutines from that thread, this will thrash the scheduler as
the current thread can't be used.
@lidavidm lidavidm marked this pull request as ready for review January 30, 2026 07:22
Copy link
Copy Markdown
Collaborator

@Mandukhai-Alimaa Mandukhai-Alimaa left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown

@amoeba amoeba left a comment

Choose a reason for hiding this comment

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

Nice. You didn't happen to have a test script you used to qualify the degree of thrashing did you?

@lidavidm
Copy link
Copy Markdown
Contributor Author

lidavidm commented Feb 1, 2026

@amoeba I just used perf to profile a C++ app calling a Go driver, and noticed quite a bit of time in futex calls. Claude provided the explanation of why those futex calls were showing up

@lidavidm lidavidm merged commit 1ee0a6f into main Feb 2, 2026
5 checks passed
@lidavidm lidavidm deleted the perf branch February 2, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants