Skip to content

chore: Add tracing spans to uninstrumented hot path functions#11959

Merged
anthonyshew merged 7 commits intomainfrom
chore/add-profiling-spans
Feb 22, 2026
Merged

chore: Add tracing spans to uninstrumented hot path functions#11959
anthonyshew merged 7 commits intomainfrom
chore/add-profiling-spans

Conversation

@anthonyshew
Copy link
Copy Markdown
Contributor

@anthonyshew anthonyshew commented Feb 22, 2026

Summary

Adds --profile visibility to several functions that were previously invisible in profile output, making it easier to identify bottlenecks in turbo run.

…very

Three targeted optimizations to the turbo run hot path:

1. Engine builder: Cache turbo.json chain per package and move the
   visited check before the expensive task_definition() call. The
   chain only depends on the package name, so multiple tasks in the
   same package reuse the cached result.

2. Task visitor: Defer env() computation to non-dry-run branches.
   The execution environment is unused during dry runs, avoiding
   per-task RwLock acquisition and env var map cloning.

3. find_untracked_files: Replace Mutex<Vec> with per-thread local
   buffers flushed via mpsc channel on drop, eliminating per-file
   mutex contention in the parallel walker.
Parallelize several sequential phases of turbo run's pre-execution
pipeline: dependency resolution, turbo.json loading, and task summary
construction. Also reduce per-call allocation overhead in the task
hash tracker and gix index classification.
…parallelize-hot-path

# Conflicts:
#	crates/turborepo-scm/src/repo_index.rs
Adds profiling visibility to functions that were invisible in
--profile output: TLS initialization, rayon-spawned hash tasks,
Visitor constructor, Engine scheduler, and per-task cache phases.
@anthonyshew anthonyshew requested a review from a team as a code owner February 22, 2026 14:09
@anthonyshew anthonyshew requested review from tknickman and removed request for a team February 22, 2026 14:09
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples-basic-web Building Building Preview, Comment, Open in v0 Feb 22, 2026 2:10pm
examples-designsystem-docs Building Building Preview, Open in v0 Feb 22, 2026 2:10pm
examples-gatsby-web Building Building Preview, Open in v0 Feb 22, 2026 2:10pm
examples-kitchensink-blog Ready Ready Preview, Comment, Open in v0 Feb 22, 2026 2:10pm
examples-nonmonorepo Ready Ready Preview, Comment, Open in v0 Feb 22, 2026 2:10pm
examples-svelte-web Building Building Preview, Comment, Open in v0 Feb 22, 2026 2:10pm
examples-tailwind-web Ready Ready Preview, Comment, Open in v0 Feb 22, 2026 2:10pm
examples-vite-web Ready Ready Preview, Comment, Open in v0 Feb 22, 2026 2:10pm
turbo-site Ready Ready Preview, Comment, Open in v0 Feb 22, 2026 2:10pm
turborepo-agents Ready Ready Preview, Comment, Open in v0 Feb 22, 2026 2:10pm
turborepo-test-coverage Ready Ready Preview, Comment, Open in v0 Feb 22, 2026 2:10pm

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report

Metric Coverage
Lines 75.16%
Functions 46.85%
Branches 0.00%

View full report

@anthonyshew anthonyshew merged commit 9c8d34e into main Feb 22, 2026
104 checks passed
@anthonyshew anthonyshew deleted the chore/add-profiling-spans branch February 22, 2026 14:36
github-actions Bot added a commit that referenced this pull request Feb 22, 2026
## Release v2.8.11-canary.21

Versioned docs: https://v2-8-11-canary-21.turborepo.dev

### Changes

- release(turborepo): 2.8.11-canary.20 (#11960) (`07defae`)
- chore: Add tracing spans to uninstrumented hot path functions (#11959)
(`9c8d34e`)

---------

Co-authored-by: Turbobot <turbobot@vercel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant