You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(wire): spin-retry on stdio EAGAIN instead of 1ms sleep; flechette incremental encoder
Two fixes to the stdio (subprocess) transport:
1. writer: the non-blocking-pipe EAGAIN branch slept 1ms (Atomics.wait) per
backpressure event. The engine drains the pipe in microseconds in lockstep,
so this slept ~1000x too long and *dominated* large-batch write time — a
4KB-row passthru spent ~13s of a 15s run asleep here. Spin-retry instead
(safe: the stdio path has a single peer, nothing to starve), with a bounded
fallback sleep so a hung reader can't pin a core. ~9-12x on wire-bound
TS workers; per-byte wire cost 20 -> 1.6 ns/byte.
2. flechette: implement createIncrementalEncoder (previously threw), unblocking
the flechette Arrow backend on the stdio transport. It carves per-message
frames (schema / dictionary / record batch) out of flechette's one-shot
stream encoder via a FlatBuffer message walk (splitIpcMessages), deferring
the schema to the first batch so dictionary ids stay consistent. Round-trips
verified for single-batch, multi-batch, and dictionary-encoded columns.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments