angular-ui / ui-grid

UI Grid: an Angular Data Grid
http://ui-grid.info
MIT License
5.39k stars 2.46k forks source link

Scroll lag + performance issues + alternative + general feedback #5585

Open Ruud-cb opened 8 years ago

Ruud-cb commented 8 years ago

I've been having an issue with scroll lag while updating the table. The normal 'lag' for virtualization is reasonable (still disappointing) but things get worse when updating data that is being sent from the server (realtime application). Data is being pushed every 0.5s and that could be an add,update or delete. The data is also sorted so new items can jump in on various locations.

I find it hard to plunker this because it doesn't illustrate an real scanario, I did my best. Best is to close the script and hide the side panel to have the full width. Don't mind the initial load, it is generating data in javascript, takes some time. https://embed.plnkr.co/eef0CMMGo7Ih2U7pS5xW/

What I have noticed mostly is the angular timers being fired, for the digest cycle. image

ghost commented 8 years ago

Can you try out some different versions of ui-grid? I'm having a similar issue (haven't composed a plunker yet) - and my findings are the bug has been introduced somewhere between 3.0.0-rc16 and 3.0.0-rc18. rc16 works relative fine, everything later incl. 3.2.1 seems to have the delay. Can you test the 3.0.0-rc16 by you?

cybermerlin commented 8 years ago

try please from pullrequest: https://github.com/angular-ui/ui-grid/pull/5546 or branch: https://github.com/cybermerlin/ui-grid/tree/bugfix/scrollbar

Ruud-cb commented 8 years ago

Hi, thanks for the responses. @jarek-jpa cloudfire or npm doesn't have 3.0.0-rc16 anymore, rc22 seems to have the same problem at least (which is the oldest available). @cybermerlin perhaps it is easier if you could build your release js and css files and try them in a fork of my plunker? https://plnkr.co/edit/eef0CMMGo7Ih2U7pS5xW?p=preview I think because tests are failing they are not merging your pull request.

Ruud-cb commented 8 years ago

Hi Angular Team,

See this as an general feedback. AngularJS has many features and sometimes it is hard to know what causes performance issues and what actually improves it. If there is one team that should be able to write good components in Angular than it should be the Angular Team itself. You should be able to know the best way to optimize any directive, service, factory, filter or an so-important ng-repeat. Unfortunately, I am a bit disappointed, With a watcher count of around 500 and a $digest cycle that takes 2000ms for the UI Grid on each scroll it has forced us to find another solution. Profiler: image

I am not advertising, but a good read would be this article which is of course written to advertise his own ag grid but he does has some good arguments that made me give it a try. So I build the same table with the same functionalities (some are not in my plunker) and the performance increase is amazing. They have the functionality between compiling the cells with angular or not, enabling it brings me back to the same performance issues then UI grid had, turning it off is a life saver. (and still be able to perform the same operations, just a little less easy, UI grid indeed does make it easier to interact with the data).

image

While I still love Angular, I have to say that this is a drawback. I'm lucky the devs of ag-grid have angularJS in mind so it integrates quite nicely.

I hope to see some major improvements in terms of performance for Angular UI Grid so that I can switch back.