Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lightning should cache the result of columnAPI.Cols() to improve performance #56705

Open
lance6716 opened this issue Oct 17, 2024 · 0 comments
Open
Labels
affects-6.5 affects-7.1 affects-7.5 affects-8.1 component/lightning This issue is related to Lightning of TiDB. severity/moderate type/bug The issue is confirmed as a bug.

Comments

@lance6716
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

capture a CPU profile when lightning encodes KV

image

func (kvcodec *tableKVEncoder) getActualDatum(rowID int64, colIndex int, inputDatum *types.Datum) (types.Datum, error) {
var (
value types.Datum
err error
)
cols := kvcodec.tbl.Cols()

some implementations of columnAPI.Cols() just return the slice, like before #50062 or after #53798. The other will filter and clone the slice.

2. What did you expect to see? (Required)

stable performance for different versions of lightning

3. What did you see instead (Required)

the duration doubles

4. What is your TiDB version? (Required)

at least v6.5.10

@kennytm kennytm added the component/lightning This issue is related to Lightning of TiDB. label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-6.5 affects-7.1 affects-7.5 affects-8.1 component/lightning This issue is related to Lightning of TiDB. severity/moderate type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

2 participants