问题描述
我是一名 Angular 前端开发人员,我是测试运行时性能的新手.
为了检查性能,我下载了谷歌插件Performance-Analyser".我得到的表演时间如下.
对于 DOM 处理本身,它需要 5.4 秒.
(对于我们的项目,我们使用的是 angular 6.)
谁能告诉一些提高性能的技巧.还请给我一些链接??
有人可以帮我吗?
有一些操作可以优化您的应用程序,例如:
构建优化
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?
解决方案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
这篇关于有多少种方法可以提高 angular 的性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!