-
Notifications
You must be signed in to change notification settings - Fork 24.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
elements: performance issue with large *ngFor loop #23813
Comments
Seems due to scheduler lacking of batch operation. Using |
Like @trotyl 's idea, or you may try to disable (window as any).__Zone_disable_requestAnimationFrame = true;
import 'zone.js/dist/zone'; // Included with Angular CLI. But it seems it will only work in local, in <script>
window.__Zone_disable_requestAnimationFrame = true;
</script> into |
The reason is I have made a PR to fix this one, #23885. |
This seems to have the same root cause as #33060. I am going to close this in favor of #33060, because #33060 it broader. I.e. this issue is specifically about instances of the same custom element created inside a single template (which might have an easier, but limited solution), while #33060 is about instances of potentially different custom elements that could be in different templates (or even different apps). |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
I create
<hello-element>
custom element from<hello>
component.And I use them in AppComponent and wrap with a large
*ngFor
loop.<hello>
components are rendered very fast, as well as I expect. But<hello-element>
elements are slow. Browser freezes for a short time.Expected behavior
Be fast as well as component.
Minimal reproduction of the problem with instructions
https://stackblitz.com/edit/angular-x6gyei?file=src%2Fapp%2Fapp.component.html
What is the motivation / use case for changing the behavior?
Environment
The text was updated successfully, but these errors were encountered: