Repository navigation
Speed up file writes: parallel file stats, single min/max pass - #10856
Conversation
Merging this PR will degrade performance by 0.17%3 warnings
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
| // `min_max` computes both extrema in one pass and caches both on `batch`, so a | ||
| // `Max` over the same batch reads the cached value instead of a second scan. | ||
| if let Some(result) = min_max(batch, ctx, *args.options)? { | ||
| partial.merge(args, result.min); | ||
| } | ||
| return Ok(true); | ||
| } | ||
|
|
There was a problem hiding this comment.
add a todo to unwind
There was a problem hiding this comment.
independent please, so we can see perf of each in isolation
File stats ran serially in front of the parallel compressors and computed min/max twice per column chunk. Compute each chunk's stats on a CPU task and merge them in stream order, and let Min/Max/BoundedMin/BoundedMax compute through `min_max`, which caches both extrema on the batch. Skip aggregates a dtype does not support before building an accumulator, so wide schemas do not build (and capture a backtrace for) one error per column. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Kruszewski <github@robertk.io>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Kruszewski <github@robertk.io>
Clone one context per task instead of taking a new kernel snapshot of the session for each chunk. The tests pass their context to the push helper. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Robert Kruszewski <github@robertk.io>
16410cb to
ac13482
Compare
|
filed #10868 |
|
and #10867 is the split |
Split out of #10856. - Allocate and free keys outside the lock. - Skip the waker lookup when no waker is registered. Most sequences never collapse, so usually no waker waits. - In `descend`, replace the parent with its child under one lock acquisition, instead of one to add the child and one to remove the parent. Signed-off-by: Robert Kruszewski <github@robertk.io>
Profiling the compress benchmark showed that file statistics, not compression, took most of the Vortex write time:
accumulate_statsran every column's aggregates in onestream.scan, in front of the parallel compressors. On CMSprovider, this alone was about as long as the full write.Max/MinandBoundedMax/BoundedMineach ran their ownmin_maxscan. String chunks were also converted from VarBin to VarBinView twice.StatsAccumulator::newcalledaccumulator()and threw the error away for each unsupported aggregate (for exampleNanCounton non-floats). Each error captures a backtrace. On a table with 10k columns, this took ~200 ms per write, and the CI benchmarks setRUST_BACKTRACE=full.Results
These numbers also include the
SequenceIdlock contention fix, which is now in #10867.Compress time, min of 3 iterations, 16 threads, Apple Silicon: