Skip to content

Commit 260c1dd

Browse files
committed
docs(JavaScript): clarify actual vs predicted metrics in Group By docs
1 parent e3554d6 commit 260c1dd

5 files changed

Lines changed: 35 additions & 39 deletions

File tree

JavaScript/2631. Group By/Claude Code Sonnet 4.6 extended/Group_By_TS.ipynb

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@
4545
"\n",
4646
"```typescript\n",
4747
"// Analyze Complexity\n",
48-
"// Runtime 98 ms\n",
49-
"// Beats 80.23%\n",
50-
"// Memory 79.27 MB\n",
51-
"// Beats 40.00%\n",
48+
"// 実測: Runtime 98 ms / Memory 79.27 MB\n",
49+
"// Beats 80.23% / 40.00%\n",
5250
"interface Array<T> {\n",
5351
" groupBy(fn: (item: T) => string): Record<string, T[]>;\n",
5452
"}\n",
@@ -137,10 +135,8 @@
137135
"\n",
138136
"```typescript\n",
139137
"// Analyze Complexity\n",
140-
"// Runtime 101 ms\n",
141-
"// Beats 70.34%\n",
142-
"// Memory 74.68 MB\n",
143-
"// Beats 90.11%\n",
138+
"// 実測: Runtime 101 ms / Memory 74.68 MB\n",
139+
"// Beats 70.34% / 90.11%\n",
144140
"interface Array<T> {\n",
145141
" groupBy(fn: (item: T) => string): Record<string, T[]>;\n",
146142
"}\n",
@@ -209,11 +205,11 @@
209205
"\n",
210206
"## 期待される改善効果\n",
211207
"\n",
212-
"| 指標 | Before | After(予測) |\n",
208+
"| 指標 | Before(実測) | After(実測) |\n",
213209
"|---|---|---|\n",
214-
"| Runtime | 98ms / Beats 80% | ~70ms / Beats ~90%+ |\n",
215-
"| Memory | 79.27MB / Beats 40% | ~74MB / Beats ~70%+ |\n",
216-
"| 主な改善理由 | — | スタックフレーム削減・プロパティ参照最小化 |\n",
210+
"| Runtime | 98 ms (Beats 80.23%) | 101 ms (Beats 70.34%) |\n",
211+
"| Memory | 79.27 MB (Beats 40.00%) | 74.68 MB (Beats 90.11%) |\n",
212+
"| 主な影響 | — | GCの影響によりRuntime微増・Memory大幅改善 |\n",
217213
"\n",
218214
"> **補足**: LeetCodeのメモリ計測はV8エンジンのGCタイミングに依存するため、実行ごとに若干ブレます。複数回提出して中央値で評価することを推奨します。"
219215
]
@@ -234,4 +230,4 @@
234230
},
235231
"nbformat": 4,
236232
"nbformat_minor": 5
237-
}
233+
}

JavaScript/2631. Group By/Claude Code Sonnet 4.6 extended/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ graph LR
128128

129129
### `reduce` vs `for` ループ 比較
130130

131-
| 項目 | `reduce` | `for` ループ |
132-
| -------------------------- | -------------- | -------------------------- |
133-
| スタックフレーム | n 回生成・破棄 | 1つを使い回す |
134-
| 関数呼び出しオーバーヘッド | あり | なし |
135-
| メモリ効率 | やや劣る | **優れる** |
136-
| 可読性 | 高い(関数型) | 高い |
137-
| LeetCode Memory | Beats ~40% | **Beats ~70%+** (実測改善) |
131+
| 項目 | `reduce` | `for` ループ |
132+
| -------------------------- | -------------- | --------------------------- |
133+
| スタックフレーム | n 回生成・破棄 | 1つを使い回す |
134+
| 関数呼び出しオーバーヘッド | あり | なし |
135+
| メモリ効率 | やや劣る | **優れる** |
136+
| 可読性 | 高い(関数型) | 高い |
137+
| LeetCode Memory | Beats 40.00% | **Beats 90.11%** (実測改善) |
138138

139139
---
140140

JavaScript/2631. Group By/Claude Code Sonnet 4.6 extended/README_react.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ <h1 class="outfit text-[2.4rem] font-extrabold text-teal-900 mb-1 leading-tight"
157157
for ループ + Object.create(null) による O(n) 実装
158158
</p>
159159
<p class="text-sm text-slate-600 mt-2">
160-
Runtime: Beats ~93% / Memory: Beats ~70% へ最適化
160+
実測: Memory Beats 90.11% へ最適化 (Runtime 101 ms / Memory 74.68 MB)
161161
</p>
162162
<nav class="flex flex-wrap gap-3 mt-6">
163163
<a
@@ -1569,17 +1569,17 @@ <h3 className="outfit mt-0 text-teal-800 text-lg font-bold">
15691569
const metrics = [
15701570
{
15711571
label: 'Runtime',
1572-
before: '98ms / Beats 80%',
1573-
after: '~70ms / Beats 93%+',
1574-
barBefore: 80,
1575-
barAfter: 93,
1572+
before: '実測: 98ms / Beats 80.23%',
1573+
after: '実測: 101ms / Beats 70.34%',
1574+
barBefore: 80.23,
1575+
barAfter: 70.34,
15761576
},
15771577
{
15781578
label: 'Memory',
1579-
before: '79.27MB / Beats 40%',
1580-
after: '~74MB / Beats 70%+',
1581-
barBefore: 40,
1582-
barAfter: 70,
1579+
before: '実測: 79.27MB / Beats 40.00%',
1580+
after: '実測: 74.68MB / Beats 90.11%',
1581+
barBefore: 40.0,
1582+
barAfter: 90.11,
15831583
},
15841584
];
15851585

public/JavaScript/2631. Group By/Claude Code Sonnet 4.6 extended/README_react.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ <h1 class="outfit text-[2.4rem] font-extrabold text-teal-900 mb-1 leading-tight"
157157
for ループ + Object.create(null) による O(n) 実装
158158
</p>
159159
<p class="text-sm text-slate-600 mt-2">
160-
Runtime: Beats ~93% / Memory: Beats ~70% へ最適化
160+
実測: Memory Beats 90.11% へ最適化 (Runtime 101 ms / Memory 74.68 MB)
161161
</p>
162162
<nav class="flex flex-wrap gap-3 mt-6">
163163
<a
@@ -1569,17 +1569,17 @@ <h3 className="outfit mt-0 text-teal-800 text-lg font-bold">
15691569
const metrics = [
15701570
{
15711571
label: 'Runtime',
1572-
before: '98ms / Beats 80%',
1573-
after: '~70ms / Beats 93%+',
1574-
barBefore: 80,
1575-
barAfter: 93,
1572+
before: '実測: 98ms / Beats 80.23%',
1573+
after: '実測: 101ms / Beats 70.34%',
1574+
barBefore: 80.23,
1575+
barAfter: 70.34,
15761576
},
15771577
{
15781578
label: 'Memory',
1579-
before: '79.27MB / Beats 40%',
1580-
after: '~74MB / Beats 70%+',
1581-
barBefore: 40,
1582-
barAfter: 70,
1579+
before: '実測: 79.27MB / Beats 40.00%',
1580+
after: '実測: 74.68MB / Beats 90.11%',
1581+
barBefore: 40.0,
1582+
barAfter: 90.11,
15831583
},
15841584
];
15851585

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ <h1 class="site-title">
797797

798798
<footer>
799799
<span class="footer-icon">🧪</span>
800-
Generated on 2026-02-28 05:40:42 UTC
800+
Generated on 2026-02-28 06:00:19 UTC
801801
</footer>
802802

803803
<script>

0 commit comments

Comments
 (0)