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

md-tabs watchers usage #3272

Closed
EricBorlandAC opened this issue Jun 15, 2015 · 5 comments
Closed

md-tabs watchers usage #3272

EricBorlandAC opened this issue Jun 15, 2015 · 5 comments
Labels
type: performance This issue is related to performance
Milestone

Comments

@EricBorlandAC
Copy link

First of all, thank you all for this awesome work. I so enjoy using the angular material module in my app and my clients love it too.

A similar issue was open few months ago: #1620

I am experiencing a performance issues when using md-tabs due to the number of watchers that each tab generates.
The fact is that each tab consumes around 30-40 watchers what I think it is a lot.

My actual application has a list of cards and each card has two tabs, if you count 30 watchers per tab, each card has, at least, 60 watchers. If my list, for example will have 50 elements, my app will have already 3000 watchers, so the performance is not really good as you can imagine. I am implementing server pagination but at this level, counting that the app has another elements (toolbar, sidenav, menus, etc) when the list is just 12 items the UX is already suffering a lot. The user should be able to see at least 50 elements without querying the server but with tabs it is completely impossible.

If i create my own (and ugly) custom tabs directive with two buttons and two ng-if's the performance is much better and the UX with 50 elements is pretty good.

I've created 3 codepens showing the watchers consumption of the md-tabs:

  1. Empty Document consuming 0 watchers: http://codepen.io/anon/pen/xGLgMd
  2. Document with a single md-tabs directive with two emtpy tab's inside, cosuming around 71 watchers: http://codepen.io/anon/pen/zGdNeo
  3. Document with an ng-repeat of 30 elements each containing an md-tabs with two empty tab's inside, consuming around 2233 watchers: http://codepen.io/anon/pen/WvERPq

Is this the expected behavior of the md-tabs? Is there any plan to improve or reduce the watchers an empty tab needs?

Thank you very much.

Eric.

@kuhnroyal
Copy link

Try the master, maybe this already helps c806e8b

@EricBorlandAC
Copy link
Author

Thanks kuhnroyal for your answer.

I've updated the codepens with the version that is currently in master:
https://cdn.rawgit.com/angular/bower-material/v0.10.0-master-5c08d5c/angular-material.js
But the problem stays there.

For sure c806e8b helps, but I think it wasn't the root of the problem. The last codepen reduced the watchers to 2175... so 58 watchers less but is not enough.

@EricBorlandAC
Copy link
Author

I've updated the plunkers to the current master version since I saw some improvements on the tabs performance but the watchers usage is exactly the same.
@robertmesserle Let me know if you need more info or some examples, thx!

@ThomasBurleson ThomasBurleson modified the milestones: 0.10.1, 0.11.0 Jul 6, 2015
@ThomasBurleson ThomasBurleson added the type: performance This issue is related to performance label Jul 6, 2015
@robertmesserle robertmesserle modified the milestones: 0.11.0, 0.10.1 Jul 7, 2015
robertmesserle pushed a commit that referenced this issue Jul 7, 2015
@robertmesserle
Copy link
Contributor

@EricBorlandAC In your second example, if you update to the latest master, the count should be down to 1508. I'm going to keep trying to get this number lower, but that was the low-hanging fruit.

@EricBorlandAC
Copy link
Author

Hi @robertmesserle I have updated that last example (http://codepen.io/anon/pen/wajzwo) and now the count is 1421 which is a huge step forward. If you can even reduce it more, it would be awesome.

Thank you for the amazing work!

@robertmesserle robertmesserle modified the milestones: Backlog, 0.11.0 Jul 20, 2015
@robertmesserle robertmesserle modified the milestones: post-1.0 , Backlog Aug 4, 2015
@ThomasBurleson ThomasBurleson modified the milestones: post-1.0 , Backlog Jan 5, 2016
@ThomasBurleson ThomasBurleson modified the milestones: Backlog, Deprecated Apr 20, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: performance This issue is related to performance
Projects
None yet
Development

No branches or pull requests

5 participants