From 17c6c48a0c4140ee1d93f8ee3a5d491472d263b0 Mon Sep 17 00:00:00 2001 From: guo-shaoge Date: Wed, 2 Nov 2022 18:18:00 +0800 Subject: [PATCH] executor: add CPU padding for chunk.Iterator4Slice (#38800) --- util/chunk/iterator.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/chunk/iterator.go b/util/chunk/iterator.go index 63aabde256c5d..74d78b9cb62ea 100644 --- a/util/chunk/iterator.go +++ b/util/chunk/iterator.go @@ -14,6 +14,8 @@ package chunk +import "golang.org/x/sys/cpu" + var ( _ Iterator = (*Iterator4Chunk)(nil) _ Iterator = (*iterator4RowPtr)(nil) @@ -58,8 +60,10 @@ func NewIterator4Slice(rows []Row) Iterator { // Iterator4Slice is used to iterate rows inside a slice. type Iterator4Slice struct { + _ cpu.CacheLinePad rows []Row cursor int + _ cpu.CacheLinePad } // Begin implements the Iterator interface.