Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 9e24e77

Browse files
jbedardNarretz
authored andcommitted
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`.
1 parent 21e4db9 commit 9e24e77

File tree

2 files changed

+425
-399
lines changed

2 files changed

+425
-399
lines changed

0 commit comments

Comments
 (0)