You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Ninja generation and the scheduler do quadratic lookups #187
NinjaBackend._write_ninja (ebuild/build/ninja_backend.py) matched each executable depends entry by scanning every target, and rebuilt the cflags string for every source.
run_graph (ebuild/core/scheduler.py) ordered freed nodes with order.index, a linear scan per node.
Measured (author's numbers, macOS, Python 3.14)
ninja large (600 targets, 24k sources): 379.7 ms -> 195.0 ms
scheduler fan-out n=4000, jobs=4: 98.5 ms -> 53.0 ms
Proposed approach
Build the static-library lookup once per manifest (a count, not a set, so output stays byte-identical when two static libraries share a name), build the cflags line once per target, and use a position map in run_graph. Add tests for internal static-library linking, per-source cflags, and parallel dispatch order. Generated build.ninja and compile_commands.json must stay byte-identical to master.
Status
Fix proposed in #186 (same author). Performance, not correctness.
Activity