Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Aquaticat/Monochromatic. TypeScript and Rust monorepo: Claude Code and Pi coding-agent plugins, a m
Something went wrong. Try again.
Performance Troubleshooting & Optimizations #
Performance troubleshooting documentation has been organized into focused areas for better maintainability and navigation.
Performance Troubleshooting Categories #
Build Performance #
Build system performance optimizations
- TypeScript scripts replacing shell commands
- File system checks vs binary execution
- Cross-platform optimization strategies
tsdown / DTS Bundling #
Why tsdown builds take 360+ms despite benchmarks showing 36ms
- DTS bundling via
rolldown-plugin-dtsis the bottleneck (~340ms for module-es) - OXC isolated declarations already active; no faster code path available
- JS event loop serialization of NAPI callbacks during the DTS second pass
- Packages that are not libraries should set
dts: false
Logging performance #
The proposed function-entry trace to debug migration was rejected after
source inspection and bounded measurements.
The console suppresses both levels by default;
verbose console.trace
emits a diagnostic stack.
The linked report records the benchmark and limits.
Quick Reference #
Performance Optimization Key Takeaways #
- WSL Environments: Avoid executing binaries when file system checks suffice
- Logging:
Do not migrate entry
tracecalls todebugfor a presumed suppressed-console speedup; use the diagnostic level the call requires - Build Scripts: Replace shell commands with TypeScript scripts for better performance and cross-platform compatibility
- Caching: Implement file-based checks before expensive operations
- Process Creation: Minimize subprocess execution in performance-critical paths
Common Performance Anti-Patterns #
- Using
console.trace()orl.trace()in tight loops or function entry points - Executing binaries when file existence checks would suffice
- Running shell commands without proper caching mechanisms
- Mixing synchronous I/O operations with performance-critical code paths
- Ignoring WSL-specific performance characteristics