You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
perf(form, ngModel): change controllers to use prototype methods
This makes the largetable-bp ng-model benchmarks 10-15% faster (down 90-100ms for me). The actual controller instantiation doesn't change too much but the overall numbers seem consistently faster, I assume all due to reducing memory usage / gc. Specifically on creation there is ~40% less memory GCed, on destruction there is about ~25% less.
PR (#13286)
BREAKING CHANGE:
The use of prototype methods instead of new methods per instance removes the ability to pass
NgModelController and FormController methods without context.
For example
`$scope.$watch('something', myNgModelCtrl.$render)`
will no longer work because the `$render` method is passed without any context.
This must now be replaced with
```
$scope.$watch('something', function() {
myNgModelCtrl.$render();
})
```
or possibly by using `Function.prototype.bind` or `angular.bind`.
0 commit comments