How many ways are there to increase the performanc

2020-03-31 07:35发布

问题:


Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed 3 months ago.

I am an angular front end developer and I am new for testing the run time performance.

For checking the performance I downloaded the google plugin, "Performance-Analyser". And I got the performance time as below.

For DOM processing itself, its taking 5.4 Secs.

(For our project, we are using angular 6.)

Can anybody tell some tips for increasing the performance. Also please some links for me??

Can anybody help me?

回答1:

there is some actions that can optimize your application like:

  1. Build optimization https://github.com/angular/angular-cli/tree/master/packages/angular_devkit/build_optimizer

  2. Using Lazy loaded modules

  3. for Run Time Performance use OnPush Change Detection to run change detection only when an Input changes and don't forget to unsubscribe from your observables
  4. Preserve Whitespaces to remove all white spaces

    "angularCompilerOptions": { "preserveWhitespaces": false }

  5. you can upgrade to newer version of angular and use Ivy Render Engine more details

  6. enable Gzip compression https://varvy.com/pagespeed/enable-compression.html
  7. Server-side rendering: Rendering the first page of your application on the server can boost performance, speed and load time

  8. you can use webpack Bundle Analyzer for performance analysis to remove unused items in your bundle link here