material icon indicating copy to clipboard operation
material copied to clipboard

Performance Issues with <md-tabs> and Internet Explorer

Open ghost opened this issue 11 years ago • 26 comments

Hi!

When I have md-tabs with md-dynamic-height everything works smooth in chrome and almost smooth in firefox.

When i try it on Internet Explorer, the performance gets really bad. It gets even worse, when I add more complex content to the tabs like inputfields, images, switches etc.

See my fiddle here: https://jsfiddle.net/72fxcg1m/1/ I also asked about the issue on stackoverflow with possible solutions: http://stackoverflow.com/questions/32872905/angular-material-tabs-performance-with-ie

ghost avatar Sep 30 '15 18:09 ghost

are there any ideas about how to solve this problem?

ghost avatar Oct 12 '15 16:10 ghost

I just experienced the same problem. After some searching I only found one solution that turned off the animation using CSS, but tab switching was still incredibly slow in IE (11). So after some thinking I came up with the following workaround. It looks very good and works very fast.

        <section class="md-whiteframe-z2">
            <md-toolbar>
                <div class="md-toolbar-tools">
                    <h3>Window</h3>
                </div>
            </md-toolbar>
            <div class="">
                <div ng-cloak>
                    <md-content>
                        <md-tabs md-dynamic-height>
                            <md-tab label="Tab 1" ng-click="tab = 'tab1'">
                                <md-content></md-content>
                            </md-tab>
                            <md-tab label="Tab 2" ng-click="tab = 'tab2'">
                                <md-content></md-content>
                            </md-tab>
                            <md-tab label="Tab 3" ng-click="tab = 'tab3'">
                                <md-content></md-content>
                            </md-tab>
                        </md-tabs>
                        <ng-include ng-if="tab == 'tab1'" src="'..'"></ng-include>
                        <ng-include ng-if="tab == 'tab2'" src="'..'"></ng-include>
                        <ng-include ng-if="tab == 'tab3'" src="'..'"></ng-include>
                    </md-content>
                </div>
            </div>
        </section>

TimKlein87 avatar Oct 12 '15 21:10 TimKlein87

Please provide a CodePen demo.

To expedite resolution, please always test with the latest versions:

  • Angular Material HEAD
  • Bower Install - https://github.com/angular/bower-material/blob/master/angular-material.js
  • Bower Install - https://github.com/angular/bower-material/blob/master/angular-material.css
  • RAWGIT - https://rawgit.com/angular/bower-material/master/angular-material.js
  • RAWGIT - https://rawgit.com/angular/bower-material/master/angular-material.css
  • AngularJS Latest Release versions:
    • Angular 1.3.19 (or greater)
    • Angular 1.4.6 (or greater).

Can you confirm the issue still exists with the above versions ?

ThomasBurleson avatar Oct 12 '15 23:10 ThomasBurleson

CodePen: http://codepen.io/anon/pen/OyjBLz Works great in Chrome, very slow in Internet Explorer (11). If it has to do with the animation, maybe something like <md-tabs md-dynamic-height md-disable-animation> can be added.

TimKlein87 avatar Oct 13 '15 09:10 TimKlein87

I am having the same problem with my app. Everything looks great on Chrome and Firefox but on IE and Edge, everything inside md-tabs-content-wrapper under the md-tabs with dynamic height does not show up. I took out the class .md-dynamic-height and the content showed up again but the content was cut off weirdly.

baolocdo avatar Jan 05 '16 04:01 baolocdo

Similar issue using md-tabs with md-dynamic-height inside md-dialog IE 11. My customer is using WIndows 8.1 and tabs are causing IE 11 to freeze and completely lock up OS to the point of hard re-boot. Have even had him export favorites and reset IE 11 to default factory settings as well as run with add-ons disabled.

Am using angular 1.4.8 and material 1.01

I can not reproduce unfortunately using VirtualBox and IE 11 in Windows 8.1. Oddly the same config seems to work fine in IE10 as well as IE11 in Windows 7

charlietfl avatar Jan 08 '16 18:01 charlietfl

+1 using complex md-tabs in IE11, even MS Edge brings the app to complete slow down.

apat183 avatar Feb 06 '16 13:02 apat183

+1. This is a big issue. Tabs are a pretty common component and for the performance in even the latest IE browsers to be so bad makes it hard to use the control.

WDShannon avatar Mar 15 '16 16:03 WDShannon

:+1: I'm getting this in IE as well, Edge is fine for me. I'm not using dynamic height.

I've just got two tabs, and switching between them is really upsetting IE.

Big problem for me as majority of clients are likely to be using IE.

ckpearson avatar Mar 29 '16 00:03 ckpearson

I'm having the same issue. I'm using a md-dialog that has 7 md-tabs. Each tab has about 10-20 href tags in the contents. It is brutally slow on IE 11 and Edge. Chrome works perfect. This issue is delaying our release. I'll try and CodePen an example.

BobKlaas avatar Mar 29 '16 21:03 BobKlaas

@BobKlaas, @ckpearson what version of Material are you using?

crisbeto avatar Apr 08 '16 15:04 crisbeto

Things are improving from 1.0.7 (about 5 seconds of delay when switching tabs, IE freeze) to 1.1.0-rc2 (slideshow at one fps), using IE11 Edge.

sdebionne avatar Apr 08 '16 15:04 sdebionne

I noticed back in Feb and was using 1.0.5

I haven't been able to try lately because I've just made my own solution similar to @TimKlein87 above and added animations myself. No performance issues at all. I noticed personally that it was really bad when using md-dynamic-height

I tried playing around with md-enable-disconnect but it didn't help much.

apat183 avatar Apr 08 '16 15:04 apat183

Well I tried looking into it a bit, it's not the animation that's causing the performance issues, but there's a lot of layout thrashing going on inside of loops. Here are a couple of cases where it happens:

https://github.com/angular/material/blob/release/1.1.0-rc2/src/components/tabs/js/tabsController.js#L497 https://github.com/angular/material/blob/release/1.1.0-rc2/src/components/tabs/js/tabsController.js#L571

I haven't looked into any ways of working around this, though. @ThomasBurleson should we invest more time into this?

crisbeto avatar Apr 08 '16 19:04 crisbeto

Pagination features have caused significant problems with Tabs. I wonder if we should supported a md-pagination-disabled attribute.

Material1 Tabs (tab-body-content areas) are not intended to have complex areas. If you experience perf issues with lots of tabs and non-trivial tab content, you should try this:

  • use a single external content to represent the current select tab content area
  • use Tabs selectedIndex to route or switch the content in the external content area

This is especially important if you are routing and the Tab construction is costly...

See the app Material Adaptive Shrine.

  • previously each tab had a child featuredItem and a productGrid component... this caused huge perf issues.
  • refactor and moved a single external productGrid outside the tabs (aka navBar)
  • uses md-on-select or databinding to update the productGrid content.

ThomasBurleson avatar Apr 08 '16 21:04 ThomasBurleson

@crisbeto We resolved our IE issues by using Angular Material v1.0.5 with AngularJS v1.5.3. Before we were using AngularJS v1.0.6 and it seemed to give us performance issues.

BobKlaas avatar Apr 08 '16 21:04 BobKlaas

still having bad performance on webview cordova app. i made a slim directive to replace md-tabs posted a question on http://stackoverflow.com/questions/36906722/replacing-angular-directive-with-static-html-reactivating-later do you think such a slim approach can work ?

alzalabany avatar Apr 28 '16 06:04 alzalabany

Hoping this issue will be resolved completely.

I'm certainly a big, big fan of this technology. In fact, I'm currently overhauling our existing system using Angular Material. Worked 100% fine in Chrome and Firefox, except IE 11. Performance is terrible, you will regret opening the application on that browser. Tried accessing https://material.angularjs.org/latest/demo/dialog as of this writing, results so far:

Chrome (Version 50) - OK Firefox (40) - OK IE 11 - Kill me now :)

Thanks!

mtorres0612 avatar Apr 29 '16 08:04 mtorres0612

I echo @mtorres0612 - The dialog page (and most I go to actually) has terrible performance in IE11.

I have a development spec machine (i7, 16Gb RAM) and after a system restart, opening IE11 and going to the dialog demo page I have terrible performance problems, both navigating around the site and when trying to open dialogs on the dialog demo page.

chris-eaton avatar Apr 29 '16 10:04 chris-eaton

@chris-eaton, @mtorres0612 please use https://material.angularjs.org/HEAD/demo/dialog, when checking this. The "latest" site is 1.0.8 where we had some performance issues that should be resolved in 1.1 (which is HEAD). That being said, dialog is still slow to open (~150ms on IE vs ~5ms on Chrome), because of a few calls to getBoundingClientRect.

crisbeto avatar May 05 '16 06:05 crisbeto