Commit 005b771
perf: Cython pread() CN/CC/SI/TX chain reader, 3x speedup on 36k-channel files
Adds read_cn_chain_fast() to dataRead.pyx: a Cython function that reads the
entire MDF4 CN linked list using POSIX pread() (zero Python file-object
dispatch), C packed structs + memcpy for zero-copy parsing, and a fast
<TX>...</TX> bytes scan replacing lxml.objectify for the common MD block
pattern. Falls back to full Python CCBlock for complex cc_type 3/7-11.
Benchmarks (3-run best):
test.mf4 (36k channels): 0.90s → 0.61s (3.1x total from 1.9s baseline)
T3 (480 channels): 0.40s → 0.33s (4.5x total from 1.5s baseline)
mdfinfo4.py: import read_cn_chain_fast; modify read_cn_blocks() to use fast
Cython path for files with fileno() (raw open() or SymBufReader), falling
back to the Python path otherwise. Post-processing handles composition blocks
(CA/CN/DS/CL/CV/CU), VLSD/VLSC detection, and CC completion.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 0f6c144 commit 005b771
3 files changed
Lines changed: 24038 additions & 17372 deletions
0 commit comments