-
Notifications
You must be signed in to change notification settings - Fork 593
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
refactor(meta): split meta into smaller crates (step 1) #12924
Conversation
Just trying my idea quickly. Feel free to leave any comments/concerns. I came up with this idea because I thought `async_trait` is a major reason of the slow compilation (#9553 (comment)). There are many `async_trait`s in tonic services, and many heavy futures to type check. We can hardly get rid of them, but maybe we can split the services into crates so that we can compile them in parallel. (a little similar to #12485, but different) As a first step, split out: - `meta/service`: tonic grpc service implementations. We may further split this into parallel sub-crates. - `meta/node`: the server binary ### Result compiling only meta takes 50s -> 42s compiling pb -> cmd_all takes 92s -> 76s ### Note In order to quickly pass compilation, some brute force is used: - All `pub(crate)` are simply replaced with `pub`. - `use risingwave_meta::*` is used without careful fine-graind imports.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license-eye has totally checked 4280 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
1904 | 1 | 2375 | 0 |
Click to see the invalid file list
- src/meta/service/src/mod.rs
Codecov Report
@@ Coverage Diff @@
## main #12924 +/- ##
==========================================
- Coverage 69.19% 68.58% -0.62%
==========================================
Files 1493 1494 +1
Lines 246484 249286 +2802
==========================================
+ Hits 170560 170964 +404
- Misses 75924 78322 +2398
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 5 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. How were you able to do this so quickly?
🤔️ It took me about 2h to do this. Steps were:
As you can see the diff of this PR is also very reviewable, so it's a relatively easy refactor. I think it should mainly because the dependency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license-eye has totally checked 4281 files.
Valid | Invalid | Ignored | Fixed |
---|---|---|---|
1904 | 1 | 2376 | 0 |
Click to see the invalid file list
- src/meta/service/src/mod.rs
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Just trying my idea quickly. Feel free to leave any comments/concerns. Will proceed if the idea sounds good.
I came up with this idea because I thought
async_trait
is a major reason of the slow compilation (#9553 (comment)). There are manyasync_trait
s in tonic services, and many heavy futures to type check. We can hardly get rid of them, but maybe we can split the services into crates so that we can compile them in parallel. (a little similar to #12485, but different)As a first step, split out:
meta/service
: tonic grpc service implementations. We may further split this into parallel sub-crates.meta/node
: the server binaryResult
A rough manual test:
compiling only meta takes 50s -> 42s
compiling pb -> cmd_all takes 92s -> 76s
Before
After
Note
In order to quickly pass compilation, some brute force is used:
pub(crate)
are simply replaced withpub
.use risingwave_meta::*
is used without careful fine-graind imports.Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
If this PR includes changes that directly affect users or other significant modifications relevant to the community, kindly draft a release note to provide a concise summary of these changes. Please prioritize highlighting the impact these changes will have on users.