AngularJS performance is affected by the number of binding the currently loaded view (page) is using and the watches that you setup manually using $watch
.
All this binding only work on properties declared on $scope.
This means if you are not binding a property to view or not watching it, you better not declare it on the $scope (also called avoiding scope pollution).
Coming to this
, as explained in the SO post this
has different context when invoked by Angular (such as in case of ng-click) and when controller is created.
So anything that you declare on this
(when referring to controller) technically cannot be bound to the view as it is not declared on the scope.
But Angular came up with a controller as
syntax where it allow us to use properties and method over the controller object. In such scenario properties declared over controller are bound in the view using ctrl.prop
syntax.
Internally Angular does something like this when you do ng-controller='HomeController as ctrl'
$scope.ctrl=this
Which basically means Angular is attaching the complete controller object to the $scope
and hence binding with controller properties work.
So only thing that matter in terms of performance is the number of binding being watched.