I keep hearing that we should disable Zone.js for performance. If I do that, how does the architecture change? I realize I would have to use ChangeDetectorRef manually or use Signals. Is it worth the complexity for a mid-sized project? I want to know the trade-offs before I make the jump.
Disabling Zone.js eliminates global monkey-patching but requires explicit state management through Signals or manual change detection triggers, which increases development complexity and error potential compared to the default automatic change detection system.
2 answers
I remember auditing a legacy angular migration where we stripped out Zone.js prematurely because the developers read a blog post about performance overhead.
The result was a nightmare of silent bugs where component states failed to sync because someone forgot to manually mark an OnPush component for check after an asynchronous callback finished.
Unless your profiling data specifically shows that zone-related micro-task execution is blocking the main thread, the risk to your system's stability and the increased complexity of unit testing state-heavy components is simply not worth the engineering hours spent refactoring.
Removing Zone.js shifts the burden of change detection from a global monkey-patching event system to localized, explicit updates triggered by Signals or manual invocation. For a mid-sized project, the overhead of managing these boundaries often outweighs the performance gains unless you are dealing with high-frequency data streams or extreme latency requirements.