-
-
Notifications
You must be signed in to change notification settings - Fork 238
Split Iter.Next(), RowToSQL, and callback into separate threads
#3310
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
Conversation
Iter.Next(), RowToSQL, and callback into separate threads
zachmu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
| }) | ||
|
|
||
| // Drain rows from rowChan, convert to wire format, and send to resChan | ||
| var resChan = make(chan *sqltypes.Result, 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason for this buffer size being different than the row one
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a buffer of *sqltypes.Result, which hold rowBatch = 128 rows each, so 512/128 = 4.
This PR expands on an optimization where we separate
iter.Next()andRowToSQL+callback()into two separate threads. Now,iter.Next(),RowToSQL, andcallback()all run in their own goroutines with corresponding buffered channels communicating between them.Additionally, this PR tidys up the
resultForDefaultIterandresultForValueItercode.Benchmarks: dolthub/dolt#10103 (comment)