1

So I have built this web project using nodejs and expressjs at backend and angularjs in frontend. I have heard that javascript is a dagger as sharp at back as it is at front. If used improperly might lead to poorly performing app. I used jshint to check my syntax practices. But as I an pretty new to angularjs, I might not have used good conventions for my application. Is there any kind of service to check the speed of my project? or some place to help me guide through good practices of angularjs, and the to figure out, if any, bad practices that I have used?

Pravin
  • 1,671
  • 5
  • 23
  • 36

3 Answers3

1

If you want to know specifically, will angular be able to serve the page fast enough, then you can keep an eye an on the watch count. It is basically the number of watches registered with angular. have a look at another SO answer

copy-pasted the code from the linked answer :

$rootScope.countWatchers = function () {
        var q = [$rootScope], watchers = 0, scope;
        while (q.length > 0) {
            scope = q.pop();
            if (scope.$$watchers) {
                watchers += scope.$$watchers.length;
            }
            if (scope.$$childHead) {
                q.push(scope.$$childHead);
            }
            if (scope.$$nextSibling) {
                q.push(scope.$$nextSibling);
            }
        }
        window.console.log(watchers);
    };

just google around for Ideal watch count for angularjs apps, and try to maintain your watch count less than that number..

Community
  • 1
  • 1
harishr
  • 17,807
  • 9
  • 78
  • 125
  • is watchers the most significant factor that affects the speed of my app or is there any other thumb rules? – Pravin Dec 24 '14 at 11:35
  • 1
    I wont say, speed of the app, little wary of generalization. But for angular, watch count is one of the most important parameter to know the refresh smoothness of your app. just google a bit on this topic and you would get to know what I mean. – harishr Dec 24 '14 at 12:29
  • yes it was pretty helpful. sorry for not selecting the answer. but the answer was pretty approximate. but so was the question. sorry for not selecting it. – Pravin Jan 01 '15 at 11:42
0

I recommend Interet Explorer 11's F12 tools for measuring latency in your HTML+JS UI to gauge code performance, it also has a profiler tool (though I'm biased, natch).

Article here: http://msdn.microsoft.com/en-gb/library/ie/dn255009(v=vs.85).aspx

Dai
  • 141,631
  • 28
  • 261
  • 374
  • I am linux user, so I don't have internet explorer. Do you know similar tool for firefox or chrome? – Pravin Dec 24 '14 at 11:00
0

i use this website to test page load speed: http://uptrends.com/ It is also cool to test your site from different locations :) If you need some further performance tips for your website, feel free to ask me. I've done a lot optimizing stuff during the last weeks.

Fabian Lurz
  • 2,029
  • 6
  • 26
  • 52
  • I dont have a specific query as for optimization. I want to check my project as a whole, whether it performs good. and I want to learn good angularjs practices for optimum performance. – Pravin Dec 24 '14 at 11:02