Skip to content

Commit

Permalink
avoid copy stack in batch-get (#1562)
Browse files Browse the repository at this point in the history
 

Signed-off-by: crazycs520 <[email protected]>
  • Loading branch information
crazycs520 authored Jan 24, 2025
1 parent e85edd4 commit d0d0c97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions txnkv/txnsnapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,9 @@ func appendBatchKeysBySize(b []batchKeys, region locate.RegionVerID, keys [][]by

//go:noinline
func growStackForBatchGetWorker() {
// A batch get worker typically needs 8KB stack space. So we pre-allocate 4KB here to let the stack grow to 8KB
// directly (instead of 2KB to 4KB to 8KB).
var ballast [4096]byte
// A batch get worker typically needs 16KB stack space. So we pre-allocate 8KB here to let the stack grow to 16KB
// directly (instead of 2KB to 4KB to 8KB to 16KB).
var ballast [8192]byte
runtime.KeepAlive(ballast[:])
}

Expand Down

0 comments on commit d0d0c97

Please sign in to comment.