-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Description
Bug, feature request, or proposal:
Bug
What is the expected behavior?
md-spinner
should not use more CPU when app is AoT compiled than when it is JiT compiledmd-spinner
should not use CPU resources once it is taken out of the DOM
What is the current behavior?
App uses AoT compilation (JiT is not affected) and has <md-spinner>
in the template
- High CPU usage even once the spinner is removed from the DOM
Zonetask.invoke
callswindow.requestAnimationFrame
in an infinite loop, choking the CPU- Minimizing the browser brings CPU utilization down. Restoring does the opposite
What are the steps to reproduce?
app.component.html
<md-card-content *ngIf="loading">
<md-spinner></md-spinner>
</md-card-content>
<md-card-content *ngIf="!loading">
Content goes here
</md-card-content>
loading===true
when AppComponent
loads, so the spinner is shown. In ngOnInit
, after data fetched from the server is received, loading=false
. The spinner disappears but CPU utilization remains high. This only affects AoT app (not in-browser compiled JiT app).
I replaced
<md-spinner></md-spinner>
with...
<md-progress-bar mode="indeterminate"></md-progress-bar>
and I no longer experience the problem.
What is the use-case or motivation for changing an existing behavior?
This makes md-spinner
too costly to use with AoT compilation
Which versions of Angular, Material, OS, browsers are affected?
Tested on Angular 2.0.1
, @angular/compiler-cli 0.6.4
, Material 9-3
, Firefox 49
, Chrome 54
, Windows 7 x64
Is there anything else we should know?
Get more details from this issue
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgent