I currently have a function that has a TTFB time of 10.28 seconds. The function simply calls an angular service, which itself uses a $http({url,method,params}) to call a method to an MVC controller which returns an IEnumerable collection. Pretty straightforward. I timed the query on the serverside-it took all of 54ms to execute. So I'm pretty sure that's not where the bottleneck is. I've commented out a couple of sections where there was a $scope.watch associated with this view, but I didn't notice any improvements. The angular code has numerous other $scope.watchCollections, but none associated with the view in question. Basically, I just need a direction or tool(s) that someone could suggest to help me find the bottleneck.
Asked
Active
Viewed 332 times
0
-
You could use the 'Network' tab in chrome dev tools to check a few metrics. https://developers.google.com/web/tools/chrome-devtools/network-performance/reference#timing – known-as-bmf May 03 '17 at 16:13
-
I know. That's where I got the TTFB number. – user2049142 May 03 '17 at 17:30
-
That probably means the problem is server-side. How large is that IEnumerable (request size) ? – known-as-bmf May 03 '17 at 17:33
-
How is that server-side? The function is responsible for loading a view. The total TTFB is 10.28 seconds. Of that, 52 millliseconds of that time is spent querying the db and returning a resultset. – user2049142 May 03 '17 at 18:55
-
Could you provide a screenshot of the network call timeline ? – known-as-bmf May 03 '17 at 19:12
-
Check this out http://stackoverflow.com/questions/23639355/extremely-long-wait-time-when-loading-rest-resource-from-angularjs – Thirumalai May 03 '17 at 21:00
-
TTFB is a measurement of the time it took from the initial request to when the browser received the first byte of data. Therefore, AngularJS or any other client-side code cannot influence that number. There is likely something else going on, on the server. For instance, if you are using an ORM, translating the data received from the database to objects, then serializing the data for the wire, could take time. It could also just be a bad network connection between you and the server causing high latency. – Heretic Monkey May 03 '17 at 21:03
-
1I still don't see how it can be the ORM. I put in a stopwatch at the controller, and from the time to the request went to the data layer and back to the controller with the data ready to go back to the client takes 40-60 milliseconds. Whatever it is, happens either between the server and client or in the client itself(Angularjs?). – user2049142 May 04 '17 at 13:50