pingcap/tidb

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

クローズ

#32,073 opened on 2022/01/30

 (3 件のコメント) (1 件のリアクション) (1 人の担当者)Go (6,186 件のフォーク)batch import
help wantedtype/enhancementtype/performance

Repository metrics

Stars
 (40,090 個のスター)
PR merge metrics
 (平均マージ 14d 4h) (30d で 346 merged PRs)

説明

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.

コントリビューターガイド