DEV Community

Discussion on: Quantum Angular: Maximizing Performance by Removing Zone

Collapse
 
rezonant profile image
Liam Lake

Why not just use NgZone to opt out of zone.js for the high frequency updates? That's what I'm doing for an angular app for broadcast monitoring where we have highly accurate playback timestamps, audio meters and other things that need to update at 60fps and it works quite well when paired with a miniature "react" like method to talk directly to the DOM. You still get the magic of zones on 90% of your app, and you only have to do the extra work on places that perform high frequency updates.

Collapse
 
gc_psk profile image
Giancarlo Buomprisco

Hi Liam,

Yes - if you got to the end of the article, you may have read that I recommend doing anything possible not to remove Zone: detaching components, blacklisting events (in my case, I could have blacklisted all WebSocket events), etc.

This was more an experiment than something I'd recommend doing. Maybe in the future, a library will be mature enough (ex ngrx component) and removing zone may be a thing to save kb on load and get the pef improvements for "free"? Who knows, but that seems the direction.

For the 99% of apps out there, no need to worry, of course :)

Collapse
 
rezonant profile image
Liam Lake

Still, the use of decorators to wrap functions for change detection is an interesting approach. Thanks for the write up