pingcap/tidb

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

Geschlossen

#32.073 geöffnet am 30.01.2022

 (3 Kommentare) (1 Reaktion) (1 zugewiesene Person)Go (6.186 Forks)batch import
help wantedtype/enhancementtype/performance

Repository-Metriken

Stars
 (40.090 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 14T 4h) (346 gemergte PRs in 30 T)

Beschreibung

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