pingcap/tidb

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

Fermée

#32 073 ouverte le 30 janv. 2022

 (3 commentaires) (1 réaction) (1 personne assignée)Go (6 186 forks)batch import
help wantedtype/enhancementtype/performance

Métriques du dépôt

Stars
 (40 090 étoiles)
Métriques de merge PR
 (Merge moyen 14j 4h) (346 PRs mergées en 30 j)

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.

Guide contributeur