문제: (1) 기능당 1 KiB 상한 테스트는 복사본 0개와 1개만 쟀다. 첫 복사본은 새 context(shape-context-0)도 만들어서, 잰 값에 context 비용이 섞였고 상한까지 40 B만 남았다. 넘으면 기능이 커졌는지 context가 비싸졌는지 알 수 없었다. (2) 성능 기준선 숫자는 performance-evidence.md, static-delivery.md, feature-shape-ceilings.json에 손으로 적혀 있었고 현재 빌드와도, 같은 파일 안에서도 서로 달랐다(1101/15-02 재발). (3) 이 테스트는 vitest 안에서 돌아 NODE_ENV=test를 물려받았다. 그래서 픽스처 vite build가 React 개발 빌드를 묶었고, 잰 합계가 운영 빌드 (약 201 KB)가 아니라 약 264 KB였다. 고른 방법: 복사본 0·1·2개를 잰다. 둘째 복사본은 같은 context에 들어가 기능 하나의 비용이고, 첫 복사본에서 그것을 뺀 나머지가 context 하나의 비용이다. 기능은 1 KiB, context는 512 B로 따로 막고 실패 메시지에 잰 값을 넣는다. 기준선은 feature-shape-ceilings.json의 initialJavascript 한 곳에 기계가 읽는 칸으로 두고, 같은 테스트가 빌드와 대조한다(합계 1%, 파일 수 정확히, 기능·context 비용 10%). 기록은 `measure-feature-shape-growth.ts --initial-baseline --write`로 다시 쓴다. 문서는 숫자 대신 그 칸을 가리킨다. 픽스처 명령은 NODE_ENV를 지우고 돈다. 버린 대안: 문서 숫자를 다시 손으로 고치기(두 번 낡았다), 문서에서 숫자를 지우고 bundle.json만 가리키기(예산을 정할 숫자를 보려면 빌드가 필요하다). 위험·한계: unit에 빌드가 하나 늘었다(약 3초). 초기 JS를 움직이는 변경은 기록도 다시 써야 test:unit이 통과한다. 그것이 목적이다. `298201f` 출처별 크기 표와 `ec7435c` HTTP/1.1 측정 표는 날짜가 붙은 측정 기록으로 남겼다. 검증: 기록을 쓰기 전 새 테스트가 실패했다. 기록 gzipBytes를 2% 바꾸면 실패하고 되돌리면 통과한다. 지금 기록: 200,939 B, 파일 25개, 기능 +765 B, context +214 B. feature-shape-growth 7건 통과, verify:documentation PASS_SCOPED. Refs: docs/reviews/2026-11-03-maturity-review/15-performance.md 15-02, 15-04
48 lines
2.5 KiB
JSON
48 lines
2.5 KiB
JSON
{
|
|
"schemaVersion": 1,
|
|
"baseline": "config/scale/feature-shape-growth.json",
|
|
"ceilings": {
|
|
"contextMaxFeatures": 200,
|
|
"appMaxContexts": 20
|
|
},
|
|
"summary": "The ceilings bound the count; they are not a verified capacity. The practical limit of one app is the initial JavaScript budget, then typecheck memory. 400 features were not measured (D-18 makes it optional).",
|
|
"axes": [
|
|
{
|
|
"axis": "Typecheck of one app",
|
|
"verified": "Linear, about 117k instantiations and 36 MB of tsc memory per feature, up to 100 features",
|
|
"condition": "Reference-shaped features, tsconfig.app.json, the host recorded in the baseline",
|
|
"notVerified": "200 features (one full context) and beyond; 4,000 (20 x 200) would need on the order of 150 GB by the same slope"
|
|
},
|
|
{
|
|
"axis": "Production build",
|
|
"verified": "Completes at 100 features in seconds",
|
|
"condition": "Same",
|
|
"notVerified": "Beyond 100"
|
|
},
|
|
{
|
|
"axis": "Initial JavaScript",
|
|
"verified": "15-01: only each feature's declaration (route table, messages, invalidation identities) loads at boot; its runtime half loads with its routes, and a copy adds no initial file. initialJavascript below is the current template build, what one more feature in an existing context adds (perFeatureGzipBytes) and what a new context adds (perContextGzipBytes); tests/unit/feature-shape-growth.test.ts measures them on every unit run, bounds a feature at 1 KiB and a context at 512 B, and fails when the record no longer matches the build. The 25- and 100-copy runs are in the baseline at its source commit (before 15-01: +3,922 B per copy)",
|
|
"condition": "Same; the feature-declarations and feature-platform chunk groups in vite.config.ts",
|
|
"notVerified": "How many more features fit: the initial budget (config/performance/budgets.json) minus initialJavascript.gzipBytes, divided by perFeatureGzipBytes (plus perContextGzipBytes per new context). The platform itself takes most of the budget"
|
|
},
|
|
{
|
|
"axis": "Lazy JavaScript",
|
|
"verified": "About 8.5 KB gzip and eight files per feature, every file far below the 120 KiB lazy-chunk budget",
|
|
"condition": "Same",
|
|
"notVerified": "Download cost of many lazy files"
|
|
},
|
|
{
|
|
"axis": "Routes",
|
|
"verified": "4 per feature, composed without conflict",
|
|
"condition": "Same",
|
|
"notVerified": "Router matching cost at runtime"
|
|
}
|
|
],
|
|
"initialJavascript": {
|
|
"gzipBytes": 200939,
|
|
"files": 25,
|
|
"perFeatureGzipBytes": 765,
|
|
"perContextGzipBytes": 214
|
|
}
|
|
}
|