0

is there any way to disable change detection on mousemove without adding onPush ?

PRAH
  • 670
  • 7
  • 19

1 Answers1

4

You can add this code in polyfills.ts before import 'zone.js/dist/zone'

(window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['mousemove'];
import 'zone.js/dist/zone';

See also

yurzui
  • 205,937
  • 32
  • 433
  • 399
jiali passion
  • 1,691
  • 1
  • 14
  • 19
  • Following your lighting talk at AC 2019, my team started improving performance by blacklisting some events. But sometimes it's tricky to find out what patch that causes the excessive CD! We can see that some material component causes microtaskDrainDone to fire, but we can't figure out which event to blame. Any tips on how to identify the particular patch? – blid Dec 12 '19 at 12:31
  • 1
    Thank you @blid, there is no easy way to do that, but I am currently working on a performance monitor zone to help to find out who trigger change detection the most, hope it can help you later. – jiali passion Dec 15 '19 at 15:36