Files
five/hbrdd/ntx
Charles KWON OhJun a9600ad45c perf: proper 3-level bulk build — INDEX 50K: 180ms → 28ms (6.4x)
bulkBuildBTree: distributes sorted keys as [M leaf] [sep] [M leaf] [sep] ...
- Separator exists ONLY in parent, never in leaf (proper B-tree)
- Works for any depth (tested 10 to 50000 keys, all correct)
- Edge case: absorb trailing 1-key into previous leaf

Eliminated per-key insertion fallback (rebuildWithInsert).
All sizes now use O(N) bulk build instead of O(N log N) insertion.

Benchmark on ext4 (home dir):
┌──────────────┬──────────┬──────────┬───────┐
│ 50K Items    │ Harbour  │ Five     │ Ratio │
├──────────────┼──────────┼──────────┼───────┤
│ APPEND 50K   │ 61ms     │ 124ms    │ 2x    │
│ INDEX NAME   │ 6ms      │ 28ms     │ 4.7x  │
│ INDEX CITY   │ 5ms      │ 36ms     │ 7.2x  │
│ SEEK 50K seq │ 23ms     │ 97ms     │ 4.2x  │
│ SEEK 50K rnd │ 63ms     │ 122ms    │ 1.9x  │
│ SCAN 50K     │ 5ms      │ 24ms     │ 4.8x  │
│ DUPKEY 50K   │ 23ms     │ 38ms     │ 1.7x  │
│ PACK 50K     │ 16ms     │ 20ms     │ 1.25x │
└──────────────┴──────────┴──────────┴───────┘

All counts correct: 50000/50000/40000

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 12:08:27 +09:00
..