问题
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:
Build optimization https://github.com/angular/angular-cli/tree/master/packages/angular_devkit/build_optimizer
Using Lazy loaded modules
- 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
Preserve Whitespaces to remove all white spaces
"angularCompilerOptions": { "preserveWhitespaces": false }
you can upgrade to newer version of angular and use Ivy Render Engine more details
- enable Gzip compression https://varvy.com/pagespeed/enable-compression.html
Server-side rendering: Rendering the first page of your application on the server can boost performance, speed and load time
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