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

Avoid using tipb.KeyRange #1685

Merged
merged 4 commits into from
Sep 5, 2016
Merged

Avoid using tipb.KeyRange #1685

merged 4 commits into from
Sep 5, 2016

Conversation

shenli
Copy link
Member

@shenli shenli commented Sep 4, 2016

We do not need to set key ranges in tipb.SelectRequest.
We only need kv.KeyRange and kvproto/coprocessor.KeyRange.
This run faster in some of our cases. I will make code more cleaner latter in this PR.

@coocood @BusyJay @tiancaiamao PTAL

@shenli
Copy link
Member Author

shenli commented Sep 4, 2016

Reduce make slice when running EncodeRowKeyWithHandle.

Before:
BenchmarkEncodeRowKeyWithHandle-4 10000000 118 ns/op
ok github.com/pingcap/tidb/tablecodec 1.324s

After:
BenchmarkEncodeRowKeyWithHandle-4 30000000 47.7 ns/op
ok github.com/pingcap/tidb/tablecodec 1.498s

@shenli
Copy link
Member Author

shenli commented Sep 4, 2016

BenchmarkEncodeEndKey-4 20000000 97.2 ns/op
BenchmarkEncodeRowKeyWithPrefixNex-4 10000000 121 ns/op

@shenli shenli changed the title [DNM]*: Avoid using tipb.KeyRange Avoid using tipb.KeyRange Sep 4, 2016
@coocood
Copy link
Member

coocood commented Sep 5, 2016

LGTM

1 similar comment
@tiancaiamao
Copy link
Contributor

LGTM

coocood added a commit that referenced this pull request Sep 5, 2016
coocood added a commit that referenced this pull request Sep 5, 2016
@shenli shenli merged commit 232605a into master Sep 5, 2016
@shenli shenli deleted the shenli/reduce-keyrange branch September 5, 2016 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants