How many ways are there to increase the performance in angular? [closed]

独自空忆成欢 提交于 2020-01-21 10:14:07

问题


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



来源:https://stackoverflow.com/questions/59608142/how-many-ways-are-there-to-increase-the-performance-in-angular

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!