-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the ngTable has slowed things down tremendously #3
Comments
@Runseb TL;DR: The problem is not ngTable, you need to cache your service call results if you want faster rendering times. Alternatively, add a loading gif to the page to indicate the items are being refreshed. I'm testing using the first tab, pods, but I believe that this same logic applies to other scenarios in which ngTable is being used. The issue I'm seeing is definitely not inherent to ngTable, but rather the service that is giving ngTable data. In the refreshPods method, I replaced the service call to an array literal and the table came right up consistently. I also noticed that the refreshPods method was getting called four times every time the page loaded. This was my initial suspicion as to the culprit of why the table was taking too long to load, but upon further investigation, once the first call to refreshPods() changes the podsReady variable to true, the view doesn't care about subsequent calls to refreshPods(). Nevertheless, it was concerning, so I figured out why. The controller was being instantiated twice due to duplicated controller entries in the routes table as well as corresponding view partials. I removed all references to controllers from the routes file. Now we're down to 2 calls to refreshPods(). The second call is coming from the ws listener. For some reason, on page load, the websocket listener you have established is firing with data and resulting in another call to refreshPods(). Again, these aren't preventing the table from loading each time, but are patterns that will give you headaches. |
Thanks a ton for checking this @raynjamin Ideally we could update all pods with the data received on the ws, but for now we are triggering a new refershPod(). Note that the refreshPod() should only be triggered if the ws receives something. it should not be triggered on every page load. |
So you have an option here.. currently refreshPods() is getting the latest data whenever the controller is instantiated, which is whenever the route calls for it. I'm thinking the best bet would to change the controller to cache the list, and refreshWhatever() will asynchronously grab the latest data and update the list, while maybe having a progress indicator. Good? |
sounds good, but updating the cached data based on what the ws sends might be a bit tricky/take time. |
I'll take a look. We might have to rethink how we uniquely identify the
|
we need to figure out what the issue is, if its inherent to ngTable we need to revert and find an alternative.
Right now the load time is terrible
The text was updated successfully, but these errors were encountered: