我创建了一个简单的项目,我已经安装了Bootstrap 4.但似乎加载页面需要8-10秒,CPU使用率为100%. 这是CPU使用率很高的桌面配置.
我通过AOT运行项目,其中ng服务--aot.在低CPU桌面上进行测试时,加载页面需要20-30秒.那么Angular是如何工作的,或者我们可以改进它并使用这种配置在低CPU桌面上加载一秒钟吗?
即使在使用AOT之后,脚本编写部分也需要6-7秒来加载页面.这似乎很多.
由于CPU使用率很高,因此在低CPU设备上花费很长时间来加载页面.
下面是我的Angular JSON文件:
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"testapp": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"prefix": "app",
"schematics": {},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/testapp",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.app.json",
"assets": [
"src/favicon.ico",
"src/assets"
],
"styles": [
"src/styles.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css"
],
"scripts": [
"node_modules/bootstrap/dist/js/bootstrap.min.js"
]
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": …Run Code Online (Sandbox Code Playgroud)