Skip to content

*: optimize debug build#12708

Merged
ti-chi-bot merged 6 commits intotikv:masterfrom
BusyJay:optimize-debug-build
Jun 1, 2022
Merged

*: optimize debug build#12708
ti-chi-bot merged 6 commits intotikv:masterfrom
BusyJay:optimize-debug-build

Conversation

@BusyJay
Copy link
Member

@BusyJay BusyJay commented May 31, 2022

What is changed and how it works?

Issue Number: Close #12707

What's Changed:

This PR optimize debug build by disabling all debuginfo excepts tests
itself. So that the generated artifacts will be smaller and also speed
up compile time a little.

My local tests show that target directory changes from 45GiB to about 9.2GiB. And build time on Linux VM (8 vcores32GiB memory 2200MHz) is changing from 17m22s to 13m46s. The improvement probably comes from writing less data to disk.

Check List

Tests

  • Unit test
  • Integration test

Release note

None

This PR optimize debug build by disabling all debuginfo excepts tests
itself. So that the generated artifacts will be smaller and also speed
up compile time a little.

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
@BusyJay BusyJay added type/enhancement The issue or PR belongs to an enhancement. needs-cherry-pick-release-6.0 needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. labels May 31, 2022
@BusyJay BusyJay requested review from Connor1996 and sticnarf May 31, 2022 07:36
@ti-chi-bot
Copy link
Member

ti-chi-bot commented May 31, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • Connor1996
  • sticnarf

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

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

Details

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 31, 2022
@BusyJay
Copy link
Member Author

BusyJay commented May 31, 2022

This is also a workaround for #4711.

[profile.dev]
opt-level = 0
debug = true
debug = 0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's handy for debugging, let's make it to 1 as least? It's enabled on purpose before #5049

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's handy for debugging

I set the tests to 1 for the exact purpose. So that we can see the exact panic point in tests. Setting global to 1 will make the target directory grow to 20GiB.

Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should update the build issues part in CONTRIBUTING.md as well

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
Copy link
Member

@Connor1996 Connor1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label May 31, 2022
@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 31, 2022
@BusyJay
Copy link
Member Author

BusyJay commented May 31, 2022

/merge

@ti-chi-bot
Copy link
Member

@BusyJay: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and if the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

If you have any questions about the PR merge process, please refer to pr process.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

DetailsCommit hash: 40727da

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label May 31, 2022
@BusyJay
Copy link
Member Author

BusyJay commented May 31, 2022

@YuJuncen PTAL at the fail case, it says tests::fatal_error from backup-stream failed.

@YuJuncen
Copy link
Contributor

YuJuncen commented Jun 1, 2022

@YuJuncen PTAL at the fail case, it says tests::fatal_error from backup-stream failed.

I have noticed that too, I have located it and would fix it soon. (Even I'm not sure how it get broken...)

@ti-chi-bot ti-chi-bot merged commit 4fca4e8 into tikv:master Jun 1, 2022
ti-srebot pushed a commit to ti-srebot/tikv that referenced this pull request Jun 1, 2022
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-6.0 in PR #12726

ti-srebot pushed a commit to ti-srebot/tikv that referenced this pull request Jun 1, 2022
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-6.1 in PR #12727

@BusyJay BusyJay deleted the optimize-debug-build branch June 1, 2022 17:47
ti-chi-bot added a commit that referenced this pull request Aug 22, 2022
close #12707, ref #12708

This PR optimize debug build by disabling all debuginfo excepts tests
itself. So that the generated artifacts will be smaller and also speed
up compile time a little.

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: Jay <BusyJay@users.noreply.github.com>
Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-cherry-pick-release-6.1 Should cherry pick this PR to release-6.1 branch. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

optimize size of target directory

6 participants