v3.21.0: Massive Performance Gains ⚡️
0
Publication Date: 12/04/2026
Author: Anas Chakroun
9-10 minutes
v3.21.0 brings enterprise-scale performance to Turbo Pro. Scan 40,000 files in seconds. Navigate massive codebases with instant responsiveness. Real-time analytics on repositories of any size.
Through fundamental engineering optimizations - TurboTextDocument, fast-glob integration, strategic filtering, and controlled concurrency - we've unlocked performance that scales effortlessly to the largest production repositories. See the benchmarks →
The Workspace Traversal Challenge
Every time Turbo Console Log starts, it needs to answer a critical question: where are all the debug logs in your workspace?
This requirement serves two distinct purposes:
📊 For Freemium Users: Workspace Analytics
The freemium panel displays real-time analytics about your debugging patterns - total log count, distribution by type (log, error, warn), and hotspot analysis showing which folders have the most logging activity. To generate these insights, Turbo must scan every supported file in your workspace.
🌳 For Pro Users: Interactive Logs Tree
Pro users get an interactive tree view that organizes all workspace logs by folder structure, with real-time filtering by log type, git changes, and file patterns. This tree must be populated with accurate log positions before it can display anything - requiring a complete workspace scan on initialization.
The challenge? On large repositories like TypeScript, Next.js, or enterprise monorepos, workspace scanning needs to be blazing fast and resource-efficient - delivering instant results without impacting VS Code responsiveness. v3.21.0 achieves exactly that.
Proving the Gains: Real-World Benchmarks
We benchmarked v3.21.0 against three production-grade repositories to demonstrate the real-world impact:
💻 Test Environment
- Machine: MacBook Pro (M1, 2020)
- Chip: Apple M1
- Memory: 16 GB unified memory
- VS Code: Latest stable version
React Repository
- Repository: facebook/react
- Supported Files: 3,853 files
- Files with Logs: 379 files
- Total Logs Detected: 2,205 logs
- Initialization Time: 1 second
Next.js Repository
- Repository: vercel/next.js
- Supported Files: 16,141 files
- Files with Logs: 1,116 files
- Total Logs Detected: 4,722 logs
- Initialization Time: 2 seconds
TypeScript Repository
- Repository: microsoft/TypeScript
- Supported Files: 39,311 files
- Files with Logs: 972 files
- Total Logs Detected: 4,190 logs
- Initialization Time: 5 seconds
These aren't synthetic tests - they're production frameworks powering millions of applications. The performance gains are consistent across different codebase structures and scales.
How We Achieved These Results
The performance gains you saw in the benchmarks come from four fundamental engineering optimizations working in concert:
1. TurboTextDocument: Lightweight File Parsing
The previous implementation used a regex pre-check to determine which files needed deeper inspection, then called vscode.workspace.openTextDocument() on matching files. While this avoided parsing every file, openTextDocument is still an expensive operation - triggering language parsing, syntax highlighting metadata, and complex VS Code infrastructure. For log detection, we only need line-by-line text access.
TurboTextDocument is a minimal wrapper around raw file content that implements only the API surface needed for detectAll operations. It uses synchronous file reads to eliminate async overhead and skips all VS Code document processing.
Before: Expensive VS Code document
const document = await vscode.workspace.openTextDocument(uri);
After: Lightweight wrapper
const content = fs.readFileSync(filePath, 'utf8');
const turboDoc = openTurboTextDocument(content);
Result: ~1000x faster file parsing for log detection operations.
2. fast-glob: Parallel Directory Scanning
The previous implementation used recursive directory traversal with fs.readdir - processing directories one-by-one in sequence. This meant scanning 40,000 files required 40,000 sequential I/O operations.
fast-glob replaces this with parallel glob pattern matching. Instead of manually walking the directory tree, we declare what we want (e.g., **/*.{js,ts,jsx,tsx,php}) and let the highly-optimized glob engine handle discovery - using all available CPU cores.
Before: Sequential recursive traversal
async function scanDir(dir) {
for (const entry of await fs.promises.readdir(dir)) {
if (entry.isDirectory()) await scanDir(entry);
else processFile(entry);
}
}
After: Parallel glob pattern
const files = await fastGlob(['**/*.{js,ts,jsx,tsx,php}'], {
cwd: dir, ignore: essentialPatterns
});
Result: TypeScript repo (40,000 files) scanned in 403ms instead of multiple seconds.
3. Two-Stage Ignore Strategy
File filtering uses a two-stage approach that balances performance with accuracy:
- Stage 1 (fast-glob): Essential patterns like
node_modules,.git,dist,buildare excluded at the glob level - preventing these directories from ever being scanned. - Stage 2 (GitIgnoreMatcher): Project-specific .gitignore rules are applied to the filtered file list - catching custom ignore patterns while operating on a much smaller set.
This strategy means we never waste time scanning massive node_modules directories, while still respecting project-specific ignore rules.
4. Controlled Concurrency
Once we have the file list, we process them with p-limit set to 16 concurrent operations. This balances throughput with system resources - allowing parallel file reads without overwhelming the disk I/O subsystem.
Each file goes through a fast regex prefilter before running the full AST detection - skipping 97.5% of files that don't contain any log statements. Result: 40,000 files processed in ~4 seconds on M1 MacBook Pro.
What This Unlocks
These optimizations unlock new possibilities across all scale levels:
- Enterprise developers working on massive monorepos get instant insights with minimal resource usage
- Open source contributors navigating large codebases benefit from sub-second log navigation
- Framework developers debugging complex build systems with thousands of files get real-time analytics
- Every developer experiences instant responsiveness regardless of project size
v3.21.0 delivers enterprise-grade performance that scales effortlessly to real-world production codebases. The engineering is invisible - the impact is immediate.