Skip to content

Native first reply: first() pays for 256 JSON-encoded rows, and the head of a columnar read is built in Python (left by #331) #381

Open

Description

@tae898

Problem

On the native wheel, query(...).first() and every small result pay for up to 256 rows. The first reply of a query is JSON and carries up to _FIRST_BATCH = 256 rows: Java encodes them all in execImpl (native/src/main/java/org/humemai/nativelib/ArcadeNative.java:241, replyOf at :600) even when the caller wants one row, and NativeResultSet builds a deque(zip(rows, meta)) from them (src/arcadedb/_native/database.py:204-230). The JVM wheel reads one row for first() (RowAccess.firstAndClose). I read this at the tag 26.11.1.post2: #331 (native column frames, in post1 and post2) did not touch it.

#331 also left the head of a columnar read on the JSON path: a result of 256 rows or fewer never uses a column frame, and colframes._head_frame (src/arcadedb/_native/colframes.py:160-181) builds the head frame column by column in Python.

What is measured

The only timings are from 26.11.1, before #331, in the large-result study (native time over JVM time, above 1 means the native wheel is slower; only figures that pass the study's rule are listed):

table rows native / JVM, 95% interval run
vec128 1M 3.58 [3.41, 3.69] ab2
vec768 100k 9.26 [8.93, 9.52] ab2
vec768 1M 9.43 [9.17, 9.52] ab2
wide 100k 11.49 [11.24, 11.49] ab3

These are baseline figures of 26.11.1 and are not measured on post2. I read the post2 code path as unchanged, so I expect the cost to be there, and I will measure it on post2 before claiming a size.

Work

Method: a timed A/B of a candidate wheel against 26.11.1.post2 with an A/A control, on the figures above and on the small-result case, before any claim. Part of #315.

Activity

  1. self-assigned this
    on Nov 13, 2026
  2. added
    pythonPull requests that update python code
    performanceSpeed or memory of the bindings, with a measurement
    nativeThe arcadedb package (native library build)
    on Nov 13, 2026
  3. added this to the 26.12.1 milestone on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestnativeThe arcadedb package (native library build)performanceSpeed or memory of the bindings, with a measurementpythonPull requests that update python code

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions