pingcap/tidb

use hack.Slice in ColumnInfo:Dump to avoid unnecessary `string to slice` conversation

Open

#32,073 opened on Jan 30, 2022

View on GitHub
 (3 comments) (1 reaction) (1 assignee)Go (40,090 stars) (6,186 forks)batch import
help wantedtype/enhancementtype/performance

Description

Enhancement

In some read-heavy workloads, we found that Column Dump causes some CPUs

image

Through the flamegraph, we can see that nearly 1% of CPU is caused by string to slice conversation. We can ensure that we don't change the slice value in the Dump function, https://github.com/pingcap/tidb/blob/master/server/column.go#L41, so we can use hack.Slice instead.

Contributor guide