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

restore: reuse bytes.Buffer #107

Merged
merged 1 commit into from Dec 21, 2018
Merged

restore: reuse bytes.Buffer #107

merged 1 commit into from Dec 21, 2018

Conversation

@lonng
Copy link
Member

lonng commented Dec 21, 2018

What problem does this PR solve?

restore: reuse bytes.Buffer in chunk.restore

benchmark (SQL file: 1529669bytes ~1.5KB, Chunk size: 64KB, Rows: 223):

func BenchmarkChunkRestoreReuseBuffer(b *testing.B) {

pkg: github.com/pingcap/tidb-lightning/lightning/restore
BenchmarkChunkRestoreReuseBuffer-8           500           2506818 ns/op         8996015 B/op        816 allocs/op
BenchmarkChunkRestoreReuseBuffer2-8         1000           2100410 ns/op         5665507 B/op        630 allocs/op
PASS

benchmark (SQL file: 1GB, Chunk size: 64KB):

goos: darwin
goarch: amd64
pkg: github.com/pingcap/tidb-lightning/lightning/restore
BenchmarkChunkRestoreReuseBuffer-8             1        2829461699 ns/op        6504717832 B/op  1342278 allocs/op
BenchmarkChunkRestoreReuseBuffer2-8            1        1476907662 ns/op        3284208384 B/op  1114627 allocs/op
PASS

What is changed and how it works?

Check List

Tests

  • Unit test
  • Integration test

Code changes

Side effects

Related changes

@sre-bot

This comment has been minimized.

Copy link

sre-bot commented Dec 21, 2018

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

@lonng

This comment has been minimized.

Copy link
Member Author

lonng commented Dec 21, 2018

/run-all-tests

@lonng

This comment has been minimized.

Copy link
Member Author

lonng commented Dec 21, 2018

/run-integration-test

Copy link
Member

kennytm left a comment

LGTM.

PTAL @csuzhangxc

@GregoryIan

This comment has been minimized.

Copy link
Collaborator

GregoryIan commented Dec 21, 2018

LGTM

@GregoryIan GregoryIan added status/LGT2 and removed status/PTAL labels Dec 21, 2018
Copy link
Member

winkyao left a comment

LGTM

@kennytm kennytm merged commit c807b62 into master Dec 21, 2018
3 checks passed
3 checks passed
jenkins-ci-lightning/build Jenkins job succeeded.
Details
jenkins-ci-lightning/integration-test Jenkins job succeeded.
Details
jenkins-ci-lightning/unit-test Jenkins job succeeded.
Details
@kennytm kennytm deleted the lonng/pr-mem-reuse branch Dec 21, 2018
@sre-bot

This comment has been minimized.

Copy link

sre-bot commented Dec 21, 2018

Hi contributor, thanks for your PR.

This patch needs to be approved by someone of admins. They should reply with "/ok-to-test" to accept this PR for running test automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.