Repository navigation
perf(jni): bound completed scan outputs with background prefetch - #78
Conversation
Signed-off-by: Christopher Wirt <[email protected]>
Signed-off-by: Christopher Wirt <[email protected]>
- Add `CurrentThreadRuntime::block_on_stream_prefetch`, a single-consumer bridge that keeps one completed item ahead and skips executor entry when an item is already queued. JNI's default scan path now calls it. - Move the producer panic test next to the bridge. - Simplify the memory harness: pass only the arguments that vary, read the buffered peak from the writer summary instead of reflection, and dedupe javac/JVM flag/variant handling. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Christopher Wirt <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Christopher Wirt <[email protected]>
|
@gitRasheed what do you think of this one? feel free to test the crap out of it w/benchmarks and everything. |
|
Ran a broader testing pass on The memory saving holds up. On the 12-core Mac, with four native workers and a fixed, pre-touched 512 MiB Java heap, these are median peak physical footprints from three fresh JVMs per variant:
RSS fell too. Narrow projections had little memory to save, so these percentages won't apply everywhere. The 18 runtime/JNI unit tests passed, full-row digests matched across 3.67 million input rows, and the ordered rewrite outputs were byte-identical. Timing is still inconclusive. Some fast JNI scans initially looked 20–30% slower, but extra repetitions were inconsistent and even unchanged control paths swung badly while other builds were running. I'd want the same checks on an idle Linux executor before calling this regression-free. |
Problem
block_on_stream_thread_safe.Fix
CurrentThreadRuntime::block_on_stream_prefetchtovortex-io. It is a single-consumer bridge that:splitConcurrencykeep the direct iterator.The new API is additive. JNI is its only caller, and other bindings are unchanged.
Results
Local Spark measurements, baseline QC
develop29348ee39. Values are medians of macOS peak physical footprint;nis runs per variant.Notes for reviewers
ArrowErrorinstead.Tests
vortex-io: one-item-ahead bound and driver panic propagation.vortex-jni: the default scan keeps one completed output ahead.🤖 Generated with Claude Code