angular / material

Material design for AngularJS
https://material.angularjs.org/
MIT License
16.54k stars 3.39k forks source link

High CPU usage #2701

Closed warpdesign closed 9 years ago

warpdesign commented 9 years ago

I'm working on a small angular-material app. Right now there are only a few Angular directives.

After some research I found out that when I disable angular-material, CPU usage drops to 1% while it is at up to 30% when the directive is loaded and used.

This is without manipulating the app. Any idea what could cause this high cpu usage ?

This is with Chrome 42/Win/64bit.

warpdesign commented 9 years ago

After some more investigation, I noticed that if I do not include material css file, cpu is fine: around 1%. If I include it it jumps to 30%.

epelc commented 9 years ago

Are you using any specific directives? Whats your layout? Can we get an example? I doubt it's angular-material in it's entirety it's probably an issue with just one or a couple of things.

Also if you have a lot of text there was an issue with it causing high resource usage because all text was set to use anti aliasing or something. I'm not sure if the fix made it into 0.9.0-rc3 or if it's coming in 0.9.0.

cleever commented 9 years ago

We can use a main angular material demo site running on a good phone like Moto X 2nd Generation to see that performance is not good enough. The application is very laggy every time I activate a sidebar and use sub menu for example. Tabs demo is very laggy too.

In a real world application on desktop, the CPU usage is too high even running in Google Chrome.

ThomasBurleson commented 9 years ago

@cleever - which version of AngularJS are you using? which version of Angular Material ?

cleever commented 9 years ago

Now I'm using #master with Angular 1.4.1.

This version is faster than a old version that I tried 11 days ago.

The demo site is faster too. But still slow when I use Tabs Demo.

ThomasBurleson commented 9 years ago

@cleever - can you re-try with the lastest changes in #master (SHA a9bc534)

BTW - we improving SideNav performances soon.

cleever commented 9 years ago

@ThomasBurleson, thanks for the attentions, but I'm still having performance issues.

ThomasBurleson commented 9 years ago

@cleever - Angular 1.4.x $$rAF apparently has some performance issues with Angular Material... we are investigating.

paambaati commented 9 years ago

For anyone facing performance issues, I'd recommend you guys switch to Angular 1.3.x till a fix lands for this. Performance is way better and I no longer face stutters or lags after downgrading from 1.4.x.

ThomasBurleson commented 9 years ago

@paambaati - Thanks for the feedback. As soon as v0.10.1 is released, we will commit to master (to be published with 0.11) these fixes for the ngAnimate compatibility issues: https://github.com/angular/material/pull/3949

ThomasBurleson commented 9 years ago

Closing this general issue for 0.11.

For any other specific component performance issues, please open new issue.