am-freescan/docs/startup-optimization-20261028.json

173 lines
6.3 KiB
JSON
Raw Normal View History

{
"date": "2026-10-28",
"request": "修复首屏、大刷新及打开测试用例配置缓慢",
"deployedFrontend": {
"mode": "built Vite preview with gzip and same-origin API/WebSocket proxy",
"localUrl": "http://localhost:5180",
"lanUrl": "http://192.168.0.222:5180",
"listen": "IPv6/IPv4 dual stack (::)",
"backendRestarted": false,
"start": "scripts/start-frontend.ps1",
"developmentStart": "scripts/start-frontend.ps1 -Dev",
"note": "Default startup builds the current source. Built serving does not apply source edits through HMR; rebuild after subsequent frontend changes."
},
"confirmedCauses": [
"Form-create, form designer, rich-text and Ace were eagerly imported by the application bootstrap or component barrels.",
"Recursive manual chunk grouping pulled shared libraries into the form-designer chunk, forcing the entry point to fetch it even after using a dynamic import.",
"The IPv4-only listener caused localhost connections to try ::1 and wait before falling back. Direct TCP checks reproduced ~2029 ms before and ~5 ms after dual-stack listening.",
"Homepage consumers issued overlapping identical overview requests; each canvas edit rebuilt the same graph snapshot multiple times."
],
"changes": [
"Lazy form-create installation, lazy designer and editor components; editor plugins register once before editor creation.",
"Move Ace mode and Monaco worker setup to their owning editor modules.",
"Exclude recursive shared dependencies from manual chunk groups; defer homepage charts while reserving layout height.",
"Merge only overlapping overview requests; retain no completed business data cache and permit retry after failure.",
"Reuse the canvas history snapshot in change notifications while isolating undo/redo data from event consumers.",
"Serve the compiled frontend on the existing port with dual-stack listening and gzip."
],
"bundleComparison": {
"scope": "entry static JS import closure, excluding dynamically loaded routes, locale, charts, CSS and images; gzip sizes summed per file",
"beforeRawBytes": 6607330,
"afterRawBytes": 4217908,
"beforeGzipBytes": 1908863,
"afterGzipBytes": 1068649,
"gzipReductionPercent": 44.0,
"formCreateAndDesignerInEntryClosureAfter": false
},
"deliveryChecks": {
"localhostHtmlBeforeDualStackMs": 2112.5,
"localhostHtmlAfterDualStackMs": 25.9,
"entryAssetBeforeDualStackMs": 2084.3,
"entryAssetAfterDualStackMs": 59.3,
"entryActualGzipWireBytes": 532959,
"lanHtmlStatus": 200,
"apiProxyBusinessCode": 0,
"webSocketUpgradeStatus": 101,
"scope": "read-only HTTP/TCP checks; no hardware commands"
},
"browserChecks": {
"scope": "IAB normal reload to actual visible content. Browser cache was not cleared; these are not FCP/LCP or cold-cache measurements.",
"flow18NodesReloadMs": [
713,
654,
607
],
"homeDataReloadMs": [
5897,
768,
733
],
"separateHomeReloadStageMs": {
"reloadCall": 272,
"headingWait": 297,
"statisticsWait": 246
},
"outlier": "Outer automation reload calls sometimes took 5.8 seconds or longer. Browser-native observations measured home content readiness at 690-919 ms. Do not interpret tool wall time as browser FCP/LCP.",
"passed": [
"Homepage statistics, shortcuts and charts render",
"Existing 18-node case renders and remains unchanged",
"Scanner parameters drawer opens on demand and cancellation preserves the saved state",
"Independent built regression page renders a form, form designer and rich-text editor without console errors"
],
"nativeWarmHomeContentReadyMs": [
759,
690,
695
],
"nativeWarmHomeFirstContentfulPaintMs": [
132,
116,
100
],
"nativeColdAssetHome": {
"firstContentfulPaintMs": 164,
"contentReadyMs": 919,
"largestLongTaskMs": 182,
"assetRequests": 201,
"assetTransferBytes": 1705274,
"cachedAssets": 0,
"revalidatedAssets": 0
},
"nativeFirstFlowAfterHome": {
"firstContentfulPaintMs": 136,
"contentReadyMs": 723,
"largestLongTaskMs": 118,
"assetRequests": 193,
"assetTransferBytes": 319658,
"cachedAssets": 0,
"revalidatedAssets": 153
},
"coldMethod": {
"assetPrefix": "cold-1793203571927",
"method": "Fresh asset URLs; validate cachedAssets=0 and revalidatedAssets=0 on the first browser load. Browser process, DNS and authenticated session remain warm."
}
},
"automatedChecks": {
"frontendTests": {
"passed": 149,
"failed": 0
},
"typeCheck": "passed",
"build": "passed",
"newCoverage": [
"overlapping load deduplication",
"retry after synchronous failure",
"one module installation",
"single snapshot for 300-node edit",
"undo/redo isolation",
"distinguish 304 cache validation from cold network loads"
],
"retainedRegressionPage": "am-web/tests/lazy-components-ui.html",
"retainedDeliveryCheck": "scripts/verify_frontend_delivery.py"
},
"cleanup": {
"businessFixturesCreated": false,
"deviceOperationsIssued": false,
"temporaryRegressionServer": "stopped after verification",
"temporaryBuildDirectories": "removed after preserving this report"
},
"completedDate": "2026-10-29",
"deliveryChecksFinal": {
"scope": "Bundle sizes and HTTP checks, not browser FCP/LCP or a cold-cache measurement",
"after": {
"staticJsFiles": 111,
"staticJsBytes": 4217908,
"staticJsGzipBytes": 1068649,
"hasFormDesigner": false,
"hasFormCreate": false
},
"before": {
"staticJsFiles": 61,
"staticJsBytes": 6607330,
"staticJsGzipBytes": 1908863,
"hasFormDesigner": true,
"hasFormCreate": true
},
"html": {
"status": 200,
"wireBytes": 85307,
"encoding": "gzip",
"elapsedMs": 23.3
},
"entryAsset": {
"status": 200,
"wireBytes": 533882,
"encoding": "gzip",
"elapsedMs": 33.3
},
"lanHtml": {
"status": 200,
"wireBytes": 263546,
"encoding": null,
"elapsedMs": 14.3
},
"apiProxy": {
"status": 200,
"wireBytes": 3093,
"encoding": null,
"elapsedMs": 221.5
},
"webSocketProxyStatus": 101
}
}