Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Pre-compute ViewFactory linking checks #1194

Closed
jbdeboer opened this issue Jul 1, 2014 · 0 comments
Closed

Pre-compute ViewFactory linking checks #1194

jbdeboer opened this issue Jul 1, 2014 · 0 comments

Comments

@jbdeboer
Copy link
Contributor

jbdeboer commented Jul 1, 2014

The following line came up hot in a profile of the TreeComponent benchmark.

https://github.com/angular/angular.dart/blob/c21ac7eaec3fd15bba7a124fdfb3e9680092a0f2/lib/core_dom/tagging_view_factory.dart#L72

The call to Element.classes.contains() involves an expensive HashMap and should be avoided.

Since the nodeList is generally a clone of the template nodes, we can pre-compute this check in the Compiler and pass it in with the templateNodes.

In fact, we could go further and pre-compute other checks as well:

  • whether or not the node has a parentNode
  • if the node is an Element or a Text / Comment node
  • if the node has any children .ng-binding elements (if not, we can skip the querySelectorAll check
jbdeboer added a commit to jbdeboer/angular.dart that referenced this issue Jul 1, 2014
The Default TreeComponent benchmark dropped from 572ms to 501ms

Closes dart-archive#1194
jbdeboer added a commit that referenced this issue Jul 1, 2014
The Default TreeComponent benchmark dropped from 572ms to 501ms

Closes #1194
Closes #1196
jbdeboer added a commit that referenced this issue Jul 1, 2014
The Default TreeComponent benchmark dropped from 572ms to 501ms

Closes #1194
Closes #1196
dsalsbury pushed a commit to dsalsbury/angular.dart that referenced this issue Jul 16, 2014
The Default TreeComponent benchmark dropped from 572ms to 501ms

Closes dart-archive#1194
Closes dart-archive#1196
dsalsbury pushed a commit to dsalsbury/angular.dart that referenced this issue Jul 16, 2014
The Default TreeComponent benchmark dropped from 572ms to 501ms

Closes dart-archive#1194
Closes dart-archive#1196
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging a pull request may close this issue.

1 participant