angular-ui / bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
http://angular-ui.github.io/bootstrap/
MIT License
14.3k stars 6.74k forks source link

Progressbar css3 animate lead to high cpu usage #1679

Closed tantion closed 10 years ago

tantion commented 10 years ago

test page http://angular-ui.github.io/bootstrap/ test browser Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.77 Safari/537.36

when progressbar is animating, the cpu usage reached 30% ~ 70%

pkozlowski-opensource commented 10 years ago

@tantion just checked on my machine (Mac, various browsers) and can't see those CPU jumps you are describing... Moreover this directive is very simple and just applies CSS classes so the animation itself are in-browser CSS3 animations.

@bekos can you see this on your end?

bekos commented 10 years ago

I can't reproduce this also. The maximum I have seen, animating the stacked bar, ie 2-4 bars at the same time, was 20%. But, then again the animations are simple CSS transitions executed by browser, the directive does not do much.

mvhecke commented 10 years ago

I can confirm that my cpu usage is around 50-55%, which seems to be caused by the progress bar and the carousel. If I apply transform: translate3d(0,0,0); on the .progress.active .progress-bar, it drops to around 30%. When you set the carousel to an extreme high interval the cpu drops to almost zero. So I guess the high cpu on the documentation is caused by more than only the progressbar.

bekos commented 10 years ago

@Gamemaniak Can you please check progressbar with the lastest master, which removed $transition dependecy.

mvhecke commented 10 years ago

@bekos It's lower now by default, around 25%, which I still think is quite high.

Edit: The things I stated do not apply to this case, but it's most likely caused by the continuous recalculate style.

bekos commented 10 years ago

@Gamemaniak At first this is good news :-) Can you test also here: http://embed.plnkr.co/7GWKC1PV74kTfcsmNOAN/preview ?

mvhecke commented 10 years ago

@bekos Looks good to me, no cpu or memory hogging. But I'm unable to pinpoint the problem in the documentation, so I will check everything separate today to find it

bekos commented 10 years ago

@Gamemaniak Nice! Thx :-)

mvhecke commented 10 years ago

@bekos It doesn't seem to be related to our code and after some digging I found out it's the continuous animated progress bar animation itself from Bootstrap that causes the problem. So this issue isn't a bug, but just default behavior of all browsers.

pkozlowski-opensource commented 10 years ago

@bekos @Gamemaniak if I understand you guys correctly, there is not much that we can do on our side, after the refactoring in the master branch, right?

bekos commented 10 years ago

Yes, I agree with @Gamemaniak (thx again btw) that this doesn't seem like a bug in our side.

pkozlowski-opensource commented 10 years ago

OK, closing then.