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

"Private" isolated scope #10140

Closed
kostat opened this issue Nov 20, 2014 · 5 comments
Closed

"Private" isolated scope #10140

kostat opened this issue Nov 20, 2014 · 5 comments

Comments

@kostat
Copy link

kostat commented Nov 20, 2014

Directives with isolated scope are usually not interested in $digest cycles unless one of the scope expressions they specified has changed. Ability to control it would significantly improve performance.

@Narretz
Copy link
Contributor

Narretz commented Nov 20, 2014

I think this is the same as #5830
However, a similar (the same?) idea called "localApply" was tested here #8055 and found to be too difficult to implement.

@Narretz Narretz closed this as completed Nov 20, 2014
@kostat
Copy link
Author

kostat commented Nov 20, 2014

@Narretz: the issue you mention is almost the opposite of my suggestion! I'm talking about skipping a scope subtree during $digest, while #5830 proposes to limit $apply.

The implementation is also relatively trivial:

  • Have a special collection of $$digestWatchers.
  • These watchers would behave exactly same as "normal" watchers except that if all of them are not dirty, the loop would not run the "normal" watchers neither for that scope, nor for its children.
  • "local" (internal) $applies will check the same after an internal $digest, whether any of 2-way $$digestWatchers is dirty and call the root's $apply
  • [I omit detailing of "private" child scopes $apply changes, but they are fairly trivial too]
  • During DDO $compilation $$digestWatchers will be initialized from the DDO's scope definition.

If I had an assertion, that the contribution would be accepted provided it passes tests/quality standards, I can do it myself (I'm a large mono contributor in the past).

P.S. I'd like also ask you to remove the resolution label.

@Narretz
Copy link
Contributor

Narretz commented Nov 21, 2014

I've reopened it, but I can't evaluate the feasability of the change. In general, a PR as a more substantial starting point is always good, and perf improvements are always welcome.

@kostat
Copy link
Author

kostat commented Nov 26, 2014

Created a relevant PR: #10221. My tests show reduce of watcher check by x3-x10.

  • There are additional optimizations that can be done in this area. I'll add more PRs when we progress with this one

@Narretz
Copy link
Contributor

Narretz commented Jan 22, 2016

See #10221 (comment)

@Narretz Narretz closed this as completed Jan 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants