Expose FFI runtime worker pool control#8789
Conversation
Signed-off-by: Onur Satici <onur@spiraldb.com>
Polar Signals Profiling ResultsLatest Run
Previous Runs (3)
Powered by Polar Signals Cloud |
Benchmarks: Vortex queriesVerdict: No clear signal (low confidence) How to read Verdict and Engines
datafusion / vortex-file-compressed (1.004x ➖, 0↑ 0↓)
datafusion / parquet (0.945x ➖, 0↑ 0↓)
duckdb / vortex-file-compressed (0.940x ➖, 0↑ 0↓)
duckdb / parquet (0.985x ➖, 0↑ 0↓)
No file size changes detected. |
myrrc
left a comment
There was a problem hiding this comment.
Unless that's absolutely critical I wouldn't like to land this even temporarily. We don't want own thread pool in the FFI, everything should run on host threads.
Same rationale applies to duckdb integration (we also use smol:: there).
Removing these functions would be a breaking change.
If we want proper parallel writes, let's land #8785 and #8773
Codecov Report✅ All modified and coverable lines are covered by tests. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
We've chatted in private. Current issue with FFI is that we don't have an explicit thread pool (which is good, library shouldn't create its own threads) but we need parallelism so we have an implicit pool that's on the users side. The need to call i.e. push() from multiple threads to have parallelism (and yet it would run on host threads) is very non-trivial and makes it hard to reason about user code calling Vortex code. As not using any of two work pool function is (allegedly) same as current behavior, it's not a breaking change. And once I wrap up my work on "bring your own scheduler" and coroutine-like FFI API, we can remove this implicit pool stuff and leave user with two choices:
|
Signed-off-by: Onur Satici <onur@spiraldb.com>
|
As a bonus, explicit thread pool would solve #7324 |
Signed-off-by: Onur Satici <onur@spiraldb.com>

Rationale for this change
The FFI runtime is caller-driven by default: it owns no threads, and host threads drive the shared executor while inside FFI calls. Concurrent calls from multiple host threads can provide parallelism, but a single host thread cannot execute internally spawned work in parallel.
What changes are included in this PR?
Exposes process-global controls for configuring optional Vortex-owned worker threads for the FFI runtime. The default remains zero workers, preserving the existing host-thread-driven execution model. Configuring a non-zero count opts into a Vortex-owned background thread pool; setting it back to zero restores the default.