-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: reuse the slice of RequestUnion objects between fetches
This commit teaches the `KVBatchFetcher`s to reuse the same slice of `RequestUnion` objects when converting spans into the BatchRequest. Due to current limitations, we cannot reuse each request deeply (i.e. we cannot reuse GetRequest or ScanRequest), but I believe it is safe to reuse the slice of interfaces. Both the non-streamer and the streamer code paths have been adjusted. Previously, this slice would be allocated and discarded after the BatchRequest completed (or, in the streamer's case, when `Streamer.Enqueue` returned), so we didn't perform the memory accounting, but now - since we will hold on to the slice - we do the memory accounting. Additionally, in order to not keep the Get and Scan requests alive, we deeply zero out the slice once it is safe to do so. Additionally, a similar optimization is applied to how resume requests are populated by the Streamer. Release note: None
- Loading branch information
1 parent
c070f2c
commit 8a0150c
Showing
20 changed files
with
230 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.