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

coprocessor: add benchmarks about Json binary codec. #2285

Merged
merged 16 commits into from Sep 19, 2017

Conversation

Projects
None yet
3 participants
@hicqu
Contributor

hicqu commented Sep 12, 2017

According to the benchmark result, we get conclusions:

  1. for decode, there's no benefit between two formats;
  2. for encode, binary format is much slower than text;

Why does the binary format performance worse? I think the reason
is we implement JsonDecoder for Read but not Read + Seek,
and implement JsonEncoder for Write but not Write + Seek.
It causes unneccessary copy of raw bytes in codec. For large and
complex Json, The influence is particularly significant.

I will raise another PR to fix this.

coprocessor: add benchmarks about Json binary codec.
According to the benchmark result, we get conclusions:
1. for decode, there's no benefit between two formats;
2. for encode, binary format is much slower than text;

Why does the binary format performance worse? I think the reason
is we implement `JsonDecoder` for `Read` but not `Read + Seek`,
and implement `JsonEncoder` for `Write` but not `Write + Seek`.
It causes unneccessary copy of raw bytes in codec. For large and
complex Json, The influence is particularly significant.

I will raise another PR to fix this.
@hicqu

This comment has been minimized.

Show comment
Hide comment
@hicqu

hicqu Sep 12, 2017

Contributor

Run new benchmarks:

cargo bench coprocessor::codec::mysql::json::binary::test -- --nocapture

@BusyJay @AndreMouche , PTAL, thanks.

Contributor

hicqu commented Sep 12, 2017

Run new benchmarks:

cargo bench coprocessor::codec::mysql::json::binary::test -- --nocapture

@BusyJay @AndreMouche , PTAL, thanks.

hicqu added some commits Sep 13, 2017

@hicqu hicqu requested a review from AndreMouche Sep 14, 2017

@hicqu

This comment has been minimized.

Show comment
Hide comment
@hicqu

hicqu Sep 15, 2017

Contributor

@AndreMouche , PTAL. Thanks.

Contributor

hicqu commented Sep 15, 2017

@AndreMouche , PTAL. Thanks.

hicqu added some commits Sep 18, 2017

address comments.
Move benchmarks about Json to benches.
@hicqu

This comment has been minimized.

Show comment
Hide comment
@hicqu

hicqu Sep 18, 2017

Contributor

@AndreMouche , the new benchmarks are moved into benches now. PTAL, thanks.

Contributor

hicqu commented Sep 18, 2017

@AndreMouche , the new benchmarks are moved into benches now. PTAL, thanks.

hicqu added some commits Sep 18, 2017

@hicqu

This comment has been minimized.

Show comment
Hide comment
@hicqu

hicqu Sep 19, 2017

Contributor

/run-all-test

Contributor

hicqu commented Sep 19, 2017

/run-all-test

@AndreMouche

LGTM

@hicqu

This comment has been minimized.

Show comment
Hide comment
@hicqu

hicqu Sep 19, 2017

Contributor

/run-all-test

Contributor

hicqu commented Sep 19, 2017

/run-all-test

@hicqu hicqu merged commit 61eb812 into master Sep 19, 2017

5 of 6 checks passed

jenkins-ci-tikv/unit-test Jenkins job failed
Details
ci/circleci Your tests passed on CircleCI!
Details
jenkins-ci-tikv/build Jenkins job succeeded.
Details
jenkins-ci-tikv/integration-common-test Jenkins job succeeded.
Details
jenkins-ci-tikv/integration-ddl-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@hicqu hicqu deleted the qupeng/cop-bench branch Sep 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment