question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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: image

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:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pauldrapercommented, May 3, 2020

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.)

0reactions
angular-automatic-lock-bot[bot]commented, Jul 28, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found