docs: add perf todo notes from #8515

This commit is contained in:
Igor Minar
2014-09-09 22:36:35 +02:00
parent b3b476db7d
commit 90cd1e0a1b
3 changed files with 5 additions and 0 deletions

View File

@@ -2195,6 +2195,8 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
if (parent) {
parent.replaceChild(newNode, firstElementToRemove);
}
// TODO(perf): what's this document fragment for? is it needed? can we at least reuse it?
var fragment = document.createDocumentFragment();
fragment.appendChild(firstElementToRemove);

View File

@@ -2131,6 +2131,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
}
// if scope model value and ngModel value are out of sync
// TODO(perf): why not move this to the action fn?
if (ctrl.$modelValue !== modelValue &&
(isUndefined(ctrl.$$invalidModelValue) || ctrl.$$invalidModelValue != modelValue)) {

View File

@@ -419,6 +419,8 @@ var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
// http://jsperf.com/clone-vs-createcomment
var endNode = ngRepeatEndComment.cloneNode(false);
clone[clone.length++] = endNode;
// TODO(perf): support naked previousNode in `enter` to avoid creation of jqLite wrapper?
$animate.enter(clone, null, jqLite(previousNode));
previousNode = endNode;
// Note: We only need the first/last node of the cloned nodes.