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

enhance: avoid memory copy and serde in mix compaction #37479

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tedxu
Copy link
Contributor

@tedxu tedxu commented Nov 6, 2024

See: #37234

@sre-ci-robot sre-ci-robot added the size/L Denotes a PR that changes 100-499 lines. label Nov 6, 2024
@sre-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tedxu
To complete the pull request process, please assign wxyucs after the PR has been reviewed.
You can assign the PR to them by writing /assign @wxyucs in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@mergify mergify bot added dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement labels Nov 6, 2024
@tedxu
Copy link
Contributor Author

tedxu commented Nov 6, 2024

In this PR, the serialization / deserialization operations and memory copies are avoided in mix compaction. From which, the mix compaction performance is improved significantly. See benchmark results below:

Before:

BenchmarkMixCompactor-8   	       1	1509607958 ns/op	1605694208 B/op	13207679 allocs/op

After

BenchmarkMixCompactor-8             3	   472317972 ns/op	924115029 B/op	  7417982 allocs/op

Copy link
Contributor

mergify bot commented Nov 6, 2024

@tedxu E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

Copy link

codecov bot commented Nov 6, 2024

Codecov Report

Attention: Patch coverage is 69.81132% with 64 lines in your changes missing coverage. Please review.

Project coverage is 82.56%. Comparing base (f813fb4) to head (b5b66db).
Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
internal/datanode/compaction/segment_writer.go 56.60% 18 Missing and 5 partials ⚠️
internal/storage/serde.go 60.00% 20 Missing and 2 partials ⚠️
internal/datanode/compaction/mix_compactor.go 73.58% 11 Missing and 3 partials ⚠️
internal/storage/serde_events.go 90.19% 3 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #37479       +/-   ##
===========================================
+ Coverage   67.31%   82.56%   +15.24%     
===========================================
  Files         290     1043      +753     
  Lines       25377   161159   +135782     
===========================================
+ Hits        17082   133056   +115974     
- Misses       8295    22841    +14546     
- Partials        0     5262     +5262     
Components Coverage Δ
Client 52.03% <ø> (∅)
Core ∅ <ø> (∅)
Go 83.20% <69.81%> (∅)
Files with missing lines Coverage Δ
internal/storage/serde_events.go 75.46% <90.19%> (ø)
internal/datanode/compaction/mix_compactor.go 76.42% <73.58%> (ø)
internal/storage/serde.go 85.49% <60.00%> (ø)
internal/datanode/compaction/segment_writer.go 74.04% <56.60%> (ø)

... and 1329 files with indirect coverage changes

@XuanYang-cn
Copy link
Contributor

/lgtm

@tedxu tedxu force-pushed the private/benchmark_batch_size branch from d2c18ad to b5b66db Compare November 7, 2024 03:25
@sre-ci-robot sre-ci-robot removed the lgtm label Nov 7, 2024
@sre-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

Copy link
Contributor

mergify bot commented Nov 7, 2024

@tedxu cpp-unit-test check failed, comment rerun cpp-unit-test can trigger the job again.

Copy link
Contributor

mergify bot commented Nov 7, 2024

@tedxu E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

@tedxu
Copy link
Contributor Author

tedxu commented Nov 7, 2024

rerun cpp-unit-test

@tedxu
Copy link
Contributor Author

tedxu commented Nov 7, 2024

/run-cpu-e2e

Copy link
Contributor

mergify bot commented Nov 7, 2024

@tedxu E2e jenkins job failed, comment /run-cpu-e2e can trigger the job again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-passed DCO check passed. kind/enhancement Issues or changes related to enhancement size/L Denotes a PR that changes 100-499 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants