DOM update spikes with angular 2 *ngFor and golden-layout -


dear fellow angular 2 developpers,

me , team facing strange performance issue our angular 2 application (2.1.1). using docking layout, based on golden-layout.js (https://golden-layout.com/). works wonderfully , drag-&-drop actions rendered smoothly.

however, when have lot of angular components (let’s say, *ngfor around 2500 elements, each of them simple component 2 property bindings), golden-layout acts strangely: when click onto angular component , start dragging, drag actions rendered huge spikes. however, when click on empty space in browser (not on html of angular component) , start dragging, animation running smoothly.

all our components use changedetectionstrategy.onpush , possible, changedetectors detached , updating triggered manually. suspect angular keep last ‚focussed‘ component in memory , perform tons of update animations when focussed element angular component.

any ideas problem might come or should search for? since see rendering work fine when click outside of angular component, there has reason, yet cannot think of way of diagnosing our problem.

thanks help.

edit: created plunkr:

 placeholder (sorry, cannot post relevant portion) 

the phenomenon can reproduced follows:

initial state: drag aroung simple component. animation should smooth. spikes: click inside complex component (which contains 5000 elements). drag. animation should render few frames. fix: perform double click simple component, followed single click, try dragging again. animation should smooth again.

the fix can achieved clicking around randomly in simple components, have not figured out logic behind whole thing yet. double clicking , single clicking works consitently (in latest chrome on several 64bit windows 10 machines @ least).


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -