This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The compiler and ngBind directives add binding information (`ng-binding` CSS class and `$binding` data object) to elements when they are bound to the scope. This is only to aid testing and debugging for tools such as Protractor and Batarang. In production this is unneccesary and add a performance penalty. This change disables adding this binding information by default. You can enable it by calling `$compilerProvider.enableBindingInfo()` in a module `config()` block. BREAKING CHANGE: The `ng-binding` CSS class and the `$binding` data object are no longer attached to DOM elements that have a binding to the scope, by default. If you relied on this feature then you can re-enable it in one of your application modules: ``` someModule.config(['$compileProvider', function($compileProvider) { $compileProvider.enableBindingInfo(); }]); ```
Node.contains is supported on IE5+ and all the other browsers we care about.
off() is called on each element removal, so we want to make it as fast as possible
@mzgol I removed a bunch of old stuff from jqlite. just fyi |
remove createXhr() method completely aswell? |
@IgorMinar thanks for the heads up. As for perf & size, httpBackend could have its xhr handling rewritten to not rely on |
This even is fired purely within jqLite/jQuery so it doesn't make sense to register DOM listener here. 6% improvement in large table benchmark for both creation and destruction
Functions with try/catch block can't be optimized, so we can move the try/catch block into a tiny fn and make it possible for the complex nodeLinkFn to get optimized.
This doesn't show up too high in profiles, but this code is cleaner anyway
while querySelectorAll is much more expensive than getElementsByTagName on elements with both many and few children, cloning the live node list returned by getElementsByTagName makes it as expensive as querySelectorAll (we need to clone because we need the node list not to change while we iterate over it). the childNodes and childNodes.length check is as expensive as querySelectorAll on a node without any children, so it only makes the whole lookup 2x as slow, so I'm removing it.
minimal perf gain (~2ms)
the previousNode was almost always correct except when we added a new block in which case incorrectly assigned the cloned collection to the variable instead of the end comment node.
…ment-transclusion templates Previously we would do it manually in all of our structural directives. BREAKING CHANGE: element-transcluded directives now have an extra comment automatically appended to their cloned DOM This comment is usually needed to keep track the end boundary in the event child directives modify the root node(s). If not used for this purpose it can be safely ignored.
…ng added This branch is not as hot as the single node branch and the slice that we need for old webkit/phantom makes for loop preferable.
the comment was moved to template but we can't clone the template via document fragment because for 1-5 elements document fragment is only an extra overhead. It only starts to make things faster when we have 10 or more root elements to clone and append
most of these commits landed in master already and the remaining todo notes were committed as 90cd1e0 |
IgorMinar
added a commit
that referenced
this pull request
Sep 9, 2014
mgallag
pushed a commit
to mgallag/angular.js
that referenced
this pull request
Sep 10, 2014
mgallag
pushed a commit
to mgallag/angular.js
that referenced
this pull request
Sep 10, 2014
mgallag
pushed a commit
to mgallag/angular.js
that referenced
this pull request
Sep 10, 2014
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this needs a lot of rebasing and polish still. I started off with @petebacondarwin's PR and added a bunch of stuff on top of it + threw in my benchpress benchmarks.