CDX internal node format fix: - Was: [child LE][recNo LE][key] (NTX-style) - Now: [key][recNo BE][child BE] (correct CDX format) - Fixes GoTop/Seek/Scan for large CDX files (50K+ records) CDX mmap: - syscall.Mmap on OpenIndex for zero-copy reads - idx.readAt() helper: mmap slice or file fallback - All ReadAt calls in Tag navigation replaced - Close: munmap CDX 50K benchmark (all counts correct): SEEK NAME 50K: 362ms (f=50000) SCAN 50K: 276ms (c=50000) SCOPE 35K: 238ms (c=35000) SEEK ID 50K: 320ms (f=50000) CDX is slower than NTX due to bit-packed leaf decompression per page. Cross-read test: 18/18 still PASS. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 lines
546 B
Plaintext
29 lines
546 B
Plaintext
PROCEDURE Main()
|
|
USE "cdx_bench" NEW
|
|
SET INDEX TO "cdx_bench.cdx"
|
|
|
|
? "Tags:", OrdCount()
|
|
? "Order1:", OrdName(1)
|
|
? "Order2:", OrdName(2)
|
|
? "Order3:", OrdName(3)
|
|
|
|
SET ORDER TO 3
|
|
? "Current:", IndexOrd()
|
|
GO TOP
|
|
? "Top:", RecNo(), EOF(), BOF()
|
|
? "Name:", RTrim(FieldGet(2))
|
|
SKIP
|
|
? "Skip:", RecNo(), EOF()
|
|
|
|
SET ORDER TO 1
|
|
GO TOP
|
|
? "City top:", RecNo(), RTrim(FieldGet(3)), EOF()
|
|
|
|
SET ORDER TO 0
|
|
GO TOP
|
|
? "Natural:", RecNo(), LTrim(Str(FieldGet(1)))
|
|
? "RC:", RecCount()
|
|
|
|
CLOSE ALL
|
|
RETURN
|