Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How $compileProvider.debugInfoEnabled set to false improve performance in angularjs 1.3?

I read the the documentation from angular website about debugInfoEnabled. Still doesn't clear with concept, how $compileProvider.debugInfoEnabled(false) inside angular config can improve the performance of application by removing the element level class (angular-directives) binding such as ng-scope and ng-isolated-scope.

Does anyone know, how performance boost can happen by setting up debugInfoEnabled to false in $compileProvider? Can anyone help me to clear out my concept about angular $compileProvider.debugInfoEnabled feature of angular 1.3?

Any Help would appreciated, Thanks in advance:)

like image 516
Pankaj Parkar Avatar asked Jan 17 '15 17:01

Pankaj Parkar


1 Answers

These classes that are added to your DOM elements are directives (directive can be elements, attributes, classes, or comments).

When angular is compiling the DOM and hits a directive it then runs through that directives logic to change, manipulate, update, or do whatever task it is that the directive is asking angular to do.

For example it will take your ng-repeat directives and build out multiple DOM elements accordingly.

By removing these directives (classes like ng-scope & ng-isolated-scope) angular will not stop at these locations and execute logic. Because of this the performance increase is achieved.

like image 88
Jacob Carter Avatar answered Nov 15 '22 15:11

Jacob Carter