This repository was archived by the owner on Nov 21, 2026. It is now read-only.
Repository navigation
benchmarks: served ArcadeDB time-series arms read query results as streamed NDJSON, behind BENCH_ARCADEDB_TS_NDJSON=1 (default off) - #293
Merged
Conversation
…reamed NDJSON, behind BENCH_ARCADEDB_TS_NDJSON=1 (default off) The PostgreSQL (psycopg) and MongoDB (cursor) arms read rows as their server sends them; the two served ArcadeDB time-series arms asked for one buffered JSON answer, which the server builds whole before sending. With the switch on, both arms send Accept: application/x-ndjson on every query and read the record lines and the last stats line through lean_http.post_ndjson, which checks stats.returned against the records read, and their rows stamp arcadedb_ts_result_format = ndjson. Unset, nothing changes. /next says the served ArcadeDB arms read a buffered answer while the rows lack the stamp, and the next-measurement list says the next measurement reads them as a stream. Registered in overrides.py, PROTOCOL.md section 7, CAMPAIGN.md row 85. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WQegLio3qLR2dE6gBFhRK6
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The PostgreSQL (psycopg) and MongoDB (cursor) time-series arms read rows as their server sends them. The two served ArcadeDB time-series arms (
arcadedb_ts_doc_server,arcadedb_ts_native_server) asked for one buffered JSON answer, which the server builds whole before the first byte (393k rows, about 20 MB, on the high-usage query at ts1000). ArcadeDB 26.10.1 answersAccept: application/x-ndjsononPOST /api/v1/query/<db>with a chunked body of{"record": ...}lines and a last{"stats": {"returned": N}}line. Measured on 26.10.1 (d36b4ca) with the lane's own query texts, the streamed read of the high-usage query took 0.86x (document arm) and 0.82x (native arm) of the buffered call's time, with identical answers.This adds
BENCH_ARCADEDB_TS_NDJSON=1, default off, following the BENCH_DENSE_ID_INDEX pattern (#292):lean_http.post_ndjsonsends the Accept header through whichever session the lane runs (lean, lean2, or requests), reads the de-chunked body, parses all lines in onejson.loads, and raisesNdjsonErrorwhenstats.returneddoes not match the records read, when the stats line is missing, or when a line is neither a record nor the stats line (so a buffered answer is never mistaken for a stream).l4_tsbs.py: both served arms use it for every_post("query", ...)when the switch is on, and their rows stamparcadedb_ts_result_format: "ndjson". Unset, the request, the answer path, and the row fields are what they were. Any value other than 1 is refused.overrides.pyentryts_ndjson, PROTOCOL.md section 7 row (with the fairness note: the PostgreSQL and MongoDB arms already stream, and buffered JSON stays available as a labelled sensitivity run), CAMPAIGN.md section 7 row 85, RESULTS-MAP field list,page_checkNOT_PRINTED entry, and runner forwarding into the lane container./next: while served ArcadeDB time-series rows lack the stamp, one sentence under the time-series table says those arms read each answer only after the server has built all of it, and a next-measurement line says the next measurement reads ArcadeDB's served time-series results as a stream, as the other served engines do.Tests:
test_ts_ndjson.py(12 tests) covers the parser and its count check, the header on the wire and the chunked body through lean and lean2 against a local stub server, the unset path unchanged with no row field, the set path stamped and parsed, a stats mismatch raising, the override registry, runner forwarding, and the /next sentence and next-measurement line keyed on unstamped rows. The whole benchmarks/experiments suite passes (640 passed, 13 skipped).Smoke (no timed A/B): runner.py, lane l4, both served ArcadeDB time-series arms at ts100, sweep tier, one worker on cores 4-7, official 26.10.1 server image, once with the switch off and once on. All six query answer digests are identical between the two runs for both arms, the high-usage query returns 32,944 rows in both, the on rows carry
arcadedb_ts_result_format: "ndjson", and the off rows have no such field.🤖 Generated with Claude Code