refactor(aggregator): accelerate build times - #3536
Draft
jpraynaud wants to merge 1 commit into
Draft
Conversation
Erase the warp filter type at each route module so downstream crates stop re-instantiating the whole router type at compile time.
Test Results 5 files ± 0 221 suites ±0 59m 10s ⏱️ - 17m 29s Results for commit 8106e8d. ± Comparison against base commit baaec57. This pull request removes 41 tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR includes the change that stops the aggregator's warp router from being one giant generic type:
BoxedFilterfrom theroutes()function of each of the 14 route modules, so the router composes 14 type-erased filters instead of a single nested tree of about 200 combinators and closures whose symbol names reached 137,000 characters.Pre-submit checklist
Comments
The cost was in rustc's monomorphization collector, not in the linker: every crate that instantiates the router walked the whole type again, while
rust-lldrelinks the 667 MB debug binary in 2.5 s.Binary crate after a library edit, dev profile,
-Ztime-passes:Measured against
mainon 6 cores, after a library edit:Measured on the earlier baseline branch:
.debug_strsectionOrperformed at every level.