Repository navigation
[lld][EVM] Assemble and link EVM objects on one thread - #208
Merged
Merged
Conversation
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this comment.
🟡 Changes recommended
The threading setting persists globally after either call and can serialize unrelated subsequent LLVM work.
1 open issue
What changed in this PR
Reduces lld overhead for small EVM objects handled by the C library entry points.
Changes:
- Adds
--threads=1to EVM assembly and linking. - Documents why serial execution is preferred for these inputs.
| File | Description |
|---|---|
| lld/lld-c/LLDAsLibraryC.cpp | Configures both EVM entry points to use single-threaded linking. |
Review effort: Balanced
hedgar2017
marked this pull request as ready for review
October 20, 2026 17:00
hedgar2017
requested review from
PavelKopyl,
abinavpp and
vladimirradosavljevic
October 20, 2026 17:00
PavelKopyl
approved these changes
Oct 26, 2026
PavelKopyl
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks!
Please, address the formatting message.
hedgar2017
force-pushed
the
perf/lld-single-thread-link
branch
from
October 27, 2026 08:42
5213349 to
331227c
Compare
hedgar2017
force-pushed
the
perf/lld-single-thread-link
branch
from
October 27, 2026 11:01
331227c to
ddf68f9
Compare
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.

LLVMAssembleEVMandLLVMLinkEVMrun lld with--threads=1. Each call handles one object of a few kilobytes, and lld's default thread pool costs more per call than the link itself: spawning the task group and waiting on its condition variables was the largest item in asampleprofile of the two calls.Benchmark, measured through the compiler that calls these two entry points once per object: Apple M2 Max (12 cores, 64 GB), macOS 27.0.1, RelWithDebInfo, 12 threads, one warm-up then 5 runs, medians, bytecode byte-identical.
Before the change the per-object cost was 0.22 ms to assemble and 0.14 ms to link regardless of the object's size.