Implement native clang launcher#27401
Open
sbc100 wants to merge 2 commits into
Open
Conversation
sbc100
marked this pull request as draft
July 22, 2026 00:32
sbc100
force-pushed
the
native_clang_impl
branch
6 times, most recently
from
July 22, 2026 21:53
198f9c8 to
c5fd0d6
Compare
sbc100
marked this pull request as ready for review
July 22, 2026 21:54
sbc100
force-pushed
the
native_clang_impl
branch
from
July 22, 2026 22:04
c5fd0d6 to
3d058e6
Compare
sbc100
force-pushed
the
native_clang_impl
branch
4 times, most recently
from
July 22, 2026 23:22
470205f to
bac6b35
Compare
Member
|
Here are some high level comments:
|
dschuff
reviewed
Jul 22, 2026
sbc100
force-pushed
the
native_clang_impl
branch
4 times, most recently
from
July 23, 2026 00:22
06b94ef to
9fec6c9
Compare
sbc100
force-pushed
the
native_clang_impl
branch
from
July 23, 2026 00:36
9fec6c9 to
b5f76dc
Compare
dschuff
reviewed
Jul 23, 2026
sbc100
force-pushed
the
native_clang_impl
branch
4 times, most recently
from
July 23, 2026 19:16
9ac1ab1 to
c94e316
Compare
sbc100
force-pushed
the
native_clang_impl
branch
7 times, most recently
from
July 23, 2026 22:37
0abdc68 to
b7f2e37
Compare
Collaborator
Author
|
Benchmark results for are in.. libc builds are much faster on all platforms! Yay |
Collaborator
Author
|
I think once we land this and we start using it everywhere we can just remove the old shell/bat/ps1/pylauncher launchers. |
sbc100
force-pushed
the
native_clang_impl
branch
from
July 24, 2026 00:37
b7f2e37 to
f9bb2cb
Compare
sbc100
force-pushed
the
native_clang_impl
branch
2 times, most recently
from
July 24, 2026 01:04
13461be to
9e62051
Compare
Implement Phase 1 of the native launcher design document. Provides high-performance native C++ compiler drivers (emcc, em++) using C++20 that directly invoke Clang for compile steps (-c, -S, -E) and seamlessly fall back to python (emcc.py / em++.py) for link steps or complex post-processing options. Output executables are placed in ./bin using CMake and Ninja. Adds CI matrix testing for Linux, macOS, and Windows. These new binaries are currently 100% optional and the python versions can still be used without building them. Tested using `embuilder build libc --force` on Linux CI (compiling 1,075 files sequentially with `EMCC_CORES=1`, `EMCC_USE_NINJA=0`, and `EMCC_BATCH_BUILD=0`): | Metric | Before (Python Baseline) | After (Native Launcher) | Improvement | | :--- | :---: | :---: | :---: | | **Total Time** | **181.96 s** (3m 2s) | **64.82 s** (1m 5s) | **-117.14 s (64.4% faster)** | | **Time per File** | 169.3 ms | 60.3 ms | **-109.0 ms / invocation** | | **Speedup Factor** | 1.0x | **2.81x** | — | **Key Takeaways:** * **64.4% Reduction in Build Time:** Bypassing Python interpreter startup shaves off **~109.0 ms of overhead per compiler invocation** on Linux CI (a **2.81x speedup**). * **Windows Impact:** Because process spawning and `python.exe` startup carry significantly higher overhead on Windows than on Linux, the percentage speedup on Windows CI is expected to be even larger. See: emscripten-core#26453
sbc100
force-pushed
the
native_clang_impl
branch
from
July 24, 2026 01:05
9e62051 to
3a2cafc
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.
Implement Phase 1 of the native launcher design document. Provides
high-performance native C++ compiler drivers (
emcc,em++) using C++20that directly invoke Clang for compile steps (-c, -S, -E) and seamlessly
fall back to python (
emcc.py/em++.py) for link steps or complexpost-processing options.
Output executables are placed in
./binusing CMake and Ninja. Adds CImatrix testing for Linux, macOS, and Windows.
These new binaries are currently 100% optional and the python versions
can still be used without building them.
Tested using
embuilder build libc --force(compiling 1,075files sequentially with
EMCC_CORES=1,EMCC_USE_NINJA=0, andEMCC_BATCH_BUILD=0). Note that this is likely an outlier sinceits perfectly suited to demonstrating to speedup from this change (i.e.
lots of small source files and no linking).
See: #26453