perf: schedule large contracts first in parallel compilation (LPT)#309
Open
hedgar2017 wants to merge 1 commit intomainfrom
Open
perf: schedule large contracts first in parallel compilation (LPT)#309hedgar2017 wants to merge 1 commit intomainfrom
hedgar2017 wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to reduce parallel compilation tail latency by scheduling the most expensive contracts first (LPT-style) before dispatching work in Project::compile_to_evm().
Changes:
- Added
Contract::estimated_compilation_cost()to estimate relative compilation cost from the contract’s IR representation. - Updated
Project::compile_to_evm()to sort contracts by estimated cost (descending) and dispatch them via a FIFO-ish work queue usingpar_bridge().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
solx-core/src/project/mod.rs |
Sorts contracts by estimated cost and switches parallel dispatch to par_bridge() to prioritize large contracts. |
solx-core/src/project/contract/mod.rs |
Introduces a cost-estimation helper used for scheduling decisions. |
e7ef7a3 to
dae55eb
Compare
Sort contracts by estimated compilation cost descending before parallel dispatch so that large contracts begin compiling first, reducing the long-tail idle time when a single big contract is the last one running. Uses par_bridge for FIFO scheduling guarantee via mutex-serialized iterator consumption.
b61b398 to
a69795e
Compare
|
📊 solx Tester Report ➡️ Download |
|
📊 Hardhat Projects Report ➡️ Download |
|
📊 Foundry Projects Report ➡️ Download |
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.
compile_to_evm()par_bridge()for FIFO scheduling — worker threads pull contracts from the sorted queue in orderTest plan