NoopAnimationDriver isn't as Noop as its name suggests
See original GitHub issue🚀 Feature request
Reduce performance hit on ssr when using angular animations.
- angular 9.1.3
Description
Profiling our ssr:
There is this AnimationEngine.flush()
call at the end, that as far as I can tell, adds ~500 ng-star-inserted
classes to all elements with an *ngIf
. And also sprinked some cpu cycles in between all over the app.
I found no official way to disable this behavior.
I monkeypatched these three methods away:
const animations = require('@angular/animations/browser');
Object.assign(animations.ɵAnimationEngine.prototype, {onInsert: () => {}, register: () => {}, registerTrigger: () => {}});
Made the ssr ~5% faster, reduced memory consumption & reduced the html output by 8kb (by omitting all those ng-star-inserted classes). The html stil works as without the patch.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:5 (4 by maintainers)
Top Results From Across the Web
What's the difference between BrowserAnimationsModule and ...
As the name noop ("no operation") says, that module doesn't do anything. It is a utility module that mocks the real animation module...
Read more >NoopAnimationsModule - Angular
A null player that must be imported to allow disabling of animations. class NoopAnimationsModule { } ...
Read more >View - Android Developers
A user interface element that indicates the progress of an operation. ... android:accessibilityPaneTitle, The title this view should present to ...
Read more >chrome/browser/flag_descriptions.cc - chromium/src - Google Git
"is no-op when the Network Service is running in the browser process.";. const char kCertDualVerificationEnabledName[] = "Cert Dual Verification";.
Read more >Unreal Engine 5.1 Release Notes
Similarly, if a title needs to teleport the camera to a completely new location, or otherwise ... Drag and drop support for the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
NoopAnimationDriver isn’t no-op from a functional rendering perspective either: https://github.com/angular/angular/issues/27917 (ngAfterViewChecked is fired with different DOM states if NoopAnimationDriver is present.)
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.