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

perf(scope): Cache the Scope.watch AST. #1173

Closed
wants to merge 1 commit into from

Conversation

jbdeboer
Copy link
Contributor

Makes NgClass 20% faster. This will effect any Scope.watch() calls.

Makes NgClass 20% faster.  This will effect any Scope.watch() calls.
@jbdeboer jbdeboer added cla: yes and removed cla: no labels Jun 24, 2014
@vicb
Copy link
Contributor

vicb commented Jun 24, 2014

two remarks:

  • We should give more information on the perf figures - adding a cache could make make things faster (hit) or slower (miss), it all depends what we measure,
  • Should the cache be added in the AstParser so the gain (on hit) is more widespread ?

@jbdeboer
Copy link
Contributor Author

@vicb, what information do you have in mind?

Having the cache in Scope.watch vs ASTParser: the code that is using Scope.watchAST does not need to cache their ASTs since they are computed outside the critical path -- adding those ASTs to the cache would increase memory pressure since the ASTs will live forever.

@vicb
Copy link
Contributor

vicb commented Jun 24, 2014

Where do we observe the speed boost ? a benchmark, a real-life app, ...

@vicb
Copy link
Contributor

vicb commented Jun 24, 2014

JS/Dart would also be important

@jbdeboer
Copy link
Contributor Author

@IgorMinar has a benchmark. I will prod him to publish it.

@jbdeboer
Copy link
Contributor Author

@IgorMinar @vicb See above. #1173 (comment)

jbdeboer added a commit that referenced this pull request Jun 25, 2014
Makes NgClass 20% faster.  This will effect any Scope.watch() calls.

Closes #1173
jbdeboer added a commit that referenced this pull request Jun 25, 2014
Makes NgClass 20% faster.  This will effect any Scope.watch() calls.

Closes #1173
jbdeboer added a commit that referenced this pull request Jun 25, 2014
Makes NgClass 20% faster.  This will effect any Scope.watch() calls.

Closes #1173
@jbdeboer jbdeboer closed this in 05e2c57 Jun 25, 2014
dsalsbury pushed a commit to dsalsbury/angular.dart that referenced this pull request Jul 16, 2014
Makes NgClass 20% faster.  This will effect any Scope.watch() calls.

Closes dart-archive#1173
dsalsbury pushed a commit to dsalsbury/angular.dart that referenced this pull request Jul 16, 2014
Makes NgClass 20% faster.  This will effect any Scope.watch() calls.

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

Successfully merging this pull request may close these issues.

3 participants