Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

chips(readonly): should not trigger excessive watchers and digests #11753

Open
marvelsrp opened this issue Jun 25, 2019 · 3 comments
Open

chips(readonly): should not trigger excessive watchers and digests #11753

marvelsrp opened this issue Jun 25, 2019 · 3 comments
Assignees
Labels
needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community P2: required Issues that must be fixed. type: performance This issue is related to performance
Milestone

Comments

@marvelsrp
Copy link

marvelsrp commented Jun 25, 2019

Test on AngularJS Material 1.1.18

Detailed Reproduction Steps:

  1. Create list with 100 items and 10 chips
this.items = Array.from(Array(100), (item, index) => ({
      name: `Item ${index}`,
      chips: Array.from(Array(10), (item, index) => `Chip ${index}`);
     })
 );

  1. Render them items
div(ng-repeat="item in controller.items")
    b {{item.name}}
    md-chips(ng-model="item.chips" readonly="true")

What is the expected behavior?

Render immediate

What is the current behavior?

Was added ~12000 watchers and make ~1000 digests (once per added chip). Page will be lags 3-6 sec.

Digests were called from here:

I think in readonly mode $timeout with call focusLastChipThenInput can not be run.

Codepen:

https://codepen.io/marvelsrp/pen/RzZXgW

@Splaktar Splaktar added the needs: demo A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue label Jun 25, 2019
@Splaktar Splaktar changed the title Too slow md-chips readonly chips: readonly chips should not trigger excessive watchers and digests Jun 25, 2019
@Splaktar Splaktar added the type: performance This issue is related to performance label Jun 25, 2019
@Splaktar
Copy link
Member

Yeah, that seems like a performance problem. Can you please provide a CodePen demo?

@marvelsrp
Copy link
Author

Yeah, that seems like a performance problem. Can you please provide a CodePen demo?

https://codepen.io/marvelsrp/pen/RzZXgW

@Splaktar Splaktar added P2: required Issues that must be fixed. and removed needs: demo A CodePen demo or GitHub repository is needed to demonstrate the reproduction of the issue labels Jun 27, 2019
@Splaktar Splaktar added this to the 1.1.20 milestone Jun 27, 2019
@Splaktar Splaktar self-assigned this Jun 27, 2019
@Splaktar Splaktar added the needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community label Jun 27, 2019
@Splaktar Splaktar changed the title chips: readonly chips should not trigger excessive watchers and digests chips(readonly): should not trigger excessive watchers and digests Jun 27, 2019
@Eduardo-Julio
Copy link

Eduardo-Julio commented Jul 10, 2019

Currently experiencing the same issue with AngularJS 1.5.10.

In my case I noticed because every time the readonly is enabled or disabled, it creates watchers and they start increasing indefinitely with each change of that attribute.

@Splaktar Splaktar modified the milestones: 1.1.20, 1.1.21 Aug 15, 2019
@Splaktar Splaktar modified the milestones: 1.1.21, 1.1.22 Sep 30, 2019
@Splaktar Splaktar modified the milestones: 1.1.22, 1.1.23 Oct 22, 2019
@Splaktar Splaktar modified the milestones: 1.1.23, 1.2.1 Jun 8, 2020
@Splaktar Splaktar modified the milestones: 1.2.1, 1.2.2 Sep 14, 2020
@Splaktar Splaktar modified the milestones: 1.2.2, - Backlog Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community P2: required Issues that must be fixed. type: performance This issue is related to performance
Projects
None yet
Development

No branches or pull requests

3 participants