ducklink: update to v4.2.0#2207
Closed
zacharywhitley wants to merge 1 commit into
Closed
Conversation
Six perf batches + a cold-start UX fix + an optional binary-size feature since v4.1.1. No API breaks, no WIT contract changes. USER-VISIBLE WINS (measured on darwin/aarch64): - Aggregate throughput on 1M-row workloads: 82 ms -> 38 ms (-54%) - Parallel scalar dispatch: 12.9 ms -> 5.75 ms (-55%) - Cold-start (offline / bad-DNS): 15 s -> 3 s - Extension binary (offline build variant): 25.9 MB -> 21.7 MB (-4 MB) Dispatch architecture: column-native aggregate UPDATE (G1/H1) with per-column typed accumulators; Weak<Instance> on CallbackEntry so dispatch prologue is one atomic upgrade instead of HashMap lookup; per-thread scratch reuse for Colvec buffers (F4, G2, I1); every docs/discovery TF caches flat_vector handles above its row loop (F2, G4). Cold-start: catalog HTTP fetch timeout shortened from 15 s to 3 s; Engine2::new spawns a background thread that populates the catalog OnceLock so the first query usually pays zero wait. New optional `network` feature (default enabled) gates reqwest + rustls + sha2 out; `--no-default-features --features loadable,advanced` sheds 4 MB from the binary for air-gapped / minimum-size distributions. The community-extensions CI runs default features so the distributed artifact keeps network support.
This was referenced Jul 9, 2026
Contributor
Author
|
Superseded by #2214 (v4.3.0). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Six perf batches + a cold-start UX fix + an optional binary-size feature since v4.1.1. No API breaks, no WIT contract changes — additive minor bump.
User-visible wins
Measured on darwin/aarch64 with lto=true, strip=true:
sample_sum(v) FROM range(1M))What's new architecturally
Dispatch (F/G/H/I/L batches)
AggStateis per-column typed accumulators picked atagg_init. Ungrouped chunks bulk-copy the whole input viaextend_from_slice. Eliminates ~10M outer Vec allocs + boxed enum variants per 10M-row aggregate.CallbackRegistryMutex → RwLock;Weak<Instance>onCallbackEntryso dispatch prologue is one atomic upgrade instead ofHashMap<name, _>::get+Arcclone.SCALAR_ARGS_SCRATCH:refill_colvecreuses Colvec buffers across chunks; TEXT/BLOB reuse viaString::clear + push_str.write_colvecskips a redundant 2048-byte null-mask scan.Discovery / docs (F1, F2, G4)
Arc<CachedDocs>with generation-counter invalidation for the docs pipeline.render_help,ducklink.docs, andducklink_searchno longer rebuild ~639 DocRows per query.flat_vectorhandles hoisted out of every discovery TF's row loop.Load-time (H4, J3)
add_to_linkercalls run ONCE per process instead of once per component load.Component::from_binaryandparse_docs_from_bytes.wasmtime::Config::memory_may_move(false)(K1): 1-2% real per-row gain via base-pointer LICM.Cold-start UX (J1)
The single most user-visible slow path in the codebase: opening DuckDB on hotel-WiFi / offline, running
SELECT * FROM ducklink.modules, and staring at a black cursor for 15 seconds while a network fetch times out before the bundled snapshot loads.Engine2::newspawns a background thread that populates the catalogOnceLockwhile DuckDB is still finishing extension setup. By the time the first user query arrives the catalog is usually already resolved. Best-effort; races are resolved viaOnceLock::get_or_init's barrier.Optional binary-size feature (J2)
New default-enabled
networkfeature gatesreqwest + rustls + webpki-roots + sha2:The offline variant is for air-gapped / minimum-size deployments; it serves only names in the bundled snapshot and refuses to download uncached blobs.
Community-extensions CI runs
cargo build --release(default features) so this PR's distributed artifact keeps full network support — no change for end users of the CI-built extension.Retracted design docs
docs/perf-ceiling-measurement.md,docs/wit-streaming-scalar-dispatch.md(RETRACTED),docs/wit-shared-memory-result.md(CANCELLED), anddocs/guest-simd-investigation.mdcapture the measurement work behind this release and the reasoning behind rejecting several proposed architectural changes (~30% streaming projection turned out to be ~1.3%; ~27% zero-copy projection turned out to be <1%). New benches (streaming_validation,memcpy_floor) let anyone reproduce the findings.PR history
Supersedes v4.1.1 (merged as #2201). All changes are on top of
v4.1.1.