perf: Send engine callback before tracker bookkeeping and add tracing spans#11970
Merged
anthonyshew merged 3 commits intomainfrom Feb 23, 2026
Merged
perf: Send engine callback before tracker bookkeeping and add tracing spans#11970anthonyshew merged 3 commits intomainfrom
anthonyshew merged 3 commits intomainfrom
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Adds visit_recv_wait, task_cache_new, and exec_context_new spans to measure where the dispatch loop spends time. Profiling shows 344ms/830ms is idle wait on the engine channel — the bottleneck is cache restore speed, not dispatch overhead.
Instruments micro_frontends_from_disk, task_access_setup, turbo_json_loader_setup, root_turbo_json_load, and pkg_dep_graph_validate to measure the sequential critical path between package graph construction and task execution.
a33e868 to
516d14f
Compare
Contributor
Coverage Report
|
Move the callback.send() in execute() to fire immediately after output_client.finish(), before the tracker.cached()/build_succeeded bookkeeping. This unblocks the engine's DAG walk sooner — dependents can be dispatched while the completed task's summary tracking runs in the background. Output ordering is preserved because the callback fires after all output is flushed, not before.
4d40e0a to
4d55c75
Compare
github-actions bot
added a commit
that referenced
this pull request
Feb 23, 2026
## Release v2.8.11-canary.26 Versioned docs: https://v2-8-11-canary-26.turborepo.dev ### Changes - release(turborepo): 2.8.11-canary.25 (#11971) (`75406f6`) - perf: Send engine callback before tracker bookkeeping and add tracing spans (#11970) (`4b5410b`) --------- Co-authored-by: Turbobot <turbobot@vercel.com>
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.
Summary
Moves the engine callback send in task
execute()to fire immediately after output is flushed (output_client.finish()), before the tracker bookkeeping (tracker.cached(),tracker.build_succeeded(), etc.). This unblocks the engine's DAG walker sooner — dependent tasks can be dispatched while the completed task's run summary tracking happens in the background.Profiled with
--profileacross three monorepos of varying size (full cache hit scenario, median of 5 warm runs).Changes
Also adds tracing spans throughout the dispatch loop and builder startup for profiling visibility:
visit_recv_wait,task_cache_new,exec_context_newin the dispatch loopmicro_frontends_from_disk,task_access_setup,turbo_json_loader_setup,root_turbo_json_load,pkg_dep_graph_validatein builder startupOutput ordering is preserved because the callback fires after all log replay and output flushing is complete.
crates/turborepo-task-executor/src/exec.rs— Restructuredexecute()to send callback immediately after output flush, before tracker bookkeeping.crates/turborepo-lib/src/task_graph/visitor/mod.rs— Addedvisit_recv_wait,task_cache_new,exec_context_newtracing spans.crates/turborepo-lib/src/run/builder.rs— Added tracing spans for uninstrumented startup phases.