小编Him*_*eam的帖子

为什么Angular 7框架在Google Chrome中的低CPU设备(Windows 10,2GB RAM,1GHz CPU)上速度极慢?

我创建了一个简单的项目,我已经安装了Bootstrap 4.但似乎加载页面需要8-10秒,CPU使用率为100%. 这是CPU使用率很高的桌面配置.

我通过AOT运行项目,其中ng服务--aot.在低CPU桌面上进行测试时,加载页面需要20-30秒.那么Angular是如何工作的,或者我们可以改进它并使用这种配置在低CPU桌面上加载一秒钟吗?

这是低CPU桌面上Angular的加载时序的屏幕截图.

即使在使用AOT之后,脚本编写部分也需要6-7秒来加载页面.这似乎很多.

具有8 GB RAM的台式机性能的屏幕截图.

由于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)

angular angular7

13
推荐指数
1
解决办法
3049
查看次数

标签 统计

angular ×1

angular7 ×1