Skip to content

Result transport: every Python read path, native against JVM #358

Open

Description

@tae898

Problem

I want to know which Python read path (iteration, to_columns, to_polars and the others) is best on each wheel, and which outliers deserve a fix PR. The first run ended weak at its cap, so one more run on the matched pair is queued for the weak paths only.

It is one row of the bindings study list. It was held on stale pins and re-pins after the 26.12.1 wheels exist.

Priority: P3 (tier 1 of the re-pin order).

Acceptance

  • The weak-path rerun is scored when it lands
  • A recommended read API per wheel is written down
  • Outliers worth a fix get their own issue

Results and the scorer output go in this issue as comments. Numbers are generated by script from the result files, never typed.

(Edited 2026-11-24: the study now measures on the 26.12.1 wheels, see #315.)

Activity

  1. added
    python
    performance
    on Nov 10, 2026
  2. added
    jvm
    native
    on Nov 10, 2026
  3. added this to the 26.12.1 milestone on Nov 10, 2026
  4. modified the milestones: 26.12.1, 27.1.1 on Nov 21, 2026
  5. tae898 commented on Nov 27, 2026

    @tae898
    CollaboratorAuthor

    I have prepared this measurement and written its rules down. It runs on the 26.12.1 wheels once they are out, native against JVM with an A/A control. It covers the seven read paths whose figures stayed weak in my first run, and the other eight are prepared as a separate second run.

    I will post the rules with the wheel hashes here before the first timed run, and the scorer output after it. Nothing has been timed yet; the scripts have only had a dry run on development wheels.

  6. added
    enhancement
    on Dec 2, 2026
  7. tae898 commented on Dec 5, 2026

    @tae898
    CollaboratorAuthor

    The final 26.12.1 wheels are not on PyPI yet, so this runs on 26.12.1.dev2, the newest ones, with an A/A control. I will repeat it on the final wheels as a new run. The rules below are fixed before the first timed run, and the rehearsal is queued first.

    I am writing the rules of this measurement down before its first run.

    Question. For each way of reading a query result from Python, how fast is the native wheel (arcadedb) against the JVM wheel (arcadedb-jvm) on 26.12.1.dev2, which read API should I recommend for each wheel, and is any path far enough behind on one wheel to be worth a fix?

    Arm wheel role
    A arcadedb 26.12.1.dev2 (native) reference
    B arcadedb-jvm 26.12.1.dev2 compared
    Z A again A/A control

    Each run is one fresh process on a fresh copy of a database of 1,000,000 documents. A call is SELECT <all columns> FROM D LIMIT n plus the read path, timed until the caller has the result. A figure is the median of the calls after the first (12 calls under 0.02 s, 6 under 0.2 s, 3 under 2 s, else the one call). Four table shapes: narrow (4 scalar columns), wide (50 columns), and the 4 scalar columns with a 128-dimension or a 768-dimension vector. Row counts 1,000, 100,000, and 1,000,000. The 100,000 and 1,000,000 figures decide; the 1,000 figures are reported only.

    part read paths runs
    1 (main) first, iter_json_batches, to_arrow, to_columns, to_dataframe, to_json_list, to_polars (the seven whose figures stayed weak in my first run) 1, at most 2
    2 (rest) iter_dicts, to_list, list(rs), iterating with to_dict(), count, iterating with get, and the last two on record rows (SELECT FROM D) 1, at most 2

    Verdict. Per figure, the median of the per-round ratios native / JVM with a 95% bootstrap interval (10,000 resamples, seed 1). Below 1.00 the native wheel is faster.

    verdict condition
    no difference the interval lies inside [0.97, 1.03]
    not resolved the interval contains 1.00 and leaves that band
    native faster the upper end is below 1.00
    JVM faster the lower end is above 1.00

    An outlier is a read figure where one wheel is more than 1.5 times slower by the median, or a path that raises on one wheel only. A recommended read API for a wheel is the fastest row-returning and the fastest columnar path by median, for each table shape and row count, named only from figures that were read. A statement over several figures is made only if every figure in it passes on its own. Medians taken from two different runs are compared only as absolute times, and I will say so where I do. Peak memory and total time are reported and decide nothing.

    Pins, validity, throttle rule, repetitions, and limits

    Pins.

    What Pin
    native wheel, linux x86_64 sha256 2913537be9f3cef65a43ea8ff29d0f998dd115e8fb870b1d9c323b989ac2d6d9
    JVM wheel, linux x86_64 sha256 5fbbdf30d2b8e0ee69aefa9c0881bd62a2858c9904588fd44d58eb9f2d498dd8
    bindings commit 4b8a5b18ea7b54deac8fc7874248f691973133aa
    engine 26.12.1.dev2, one engine version and build commit in every run
    Python 3.12, numpy 2.5.4, pyarrow 26.0.0, pandas 3.1.0, polars 2.1.0, JPype1 1.7.1 (JVM arm only)
    heap JVM wheel: its default (half of the physical memory). Native wheel: the equal -Xmx, which is its default written out
    host my laptop (Core Ultra X9 388H, Linux), two pinned E cores, turbo on, powersave governor, editor, browser, and agent sessions held on other cores. The figures are relative only
    kit the checksum file of the scripts has sha256 596deff5f85348958d797e99a23dc4cbca433cd4270bbef40128b8c0073f6ddc

    Grid. Row-returning paths run where rows times values per row is at most 150 million, columnar paths where it is at most 800 million. With the 768-dimension vector, the record-row, JSON, and columnar paths run at 1,000 rows only, because their projected peak memory on the JVM was above 12,000 MiB.

    Validity, checked before any verdict. A table shape is INVALID when a run did not use the wheel of its arm, a wheel version, commit, engine version, or engine build commit differs from the pins or between runs, the runs of one wheel did not all get the same maximum heap, the decoded first 20 rows differ between runs of the same wheel, or the throttle counters cannot be read. A run counts only when the table has 1,000,000 rows, a stored record equals the generator, and every call returned the right number of rows. A run that fails is left out and listed; a table shape stops after a failed run in its first round, or after 3 failed runs in a row. A difference between the wheels in the decoded rows is listed as a finding. A figure is INVALID when the A/A control has fewer than 10 clean pairs, or its interval excludes 1.00 and overlaps the interval of B against A, or another timed job overlapped. A figure is WEAK with fewer than 10 clean pairs of B against A, or with an interval wider than 0.10 times its median. INVALID and WEAK report no result.

    Throttle and interference rule. A run starts when the package is at most 70 C (after the first run of a round also at most 2 C above that run's start), after at most 180 s of waiting. A pair is dropped when the two runs' throttled share of the timed window (core throttle time of the two cores) differs by more than 1 percentage point, when their start temperatures differ by more than 5 C, or when my interference sampler marked either run (more than half a core of other work on a group of cores, other benchmark work, a camera, or a suspend).

    Repetitions and stopping. In a round, each table shape runs the three arms back to back, the order rotated and reversed from round to round. Rounds 0 to 12 (round 0 is dropped), then 2 more for a shape that has a weak or invalid figure, at most up to round 20. No round starts that is not expected to end 15 minutes before the 11-hour time limit of a run. A study that is not complete then goes on in the next run, at most 2 runs, and nothing is read between the runs. After the last run the verdict is read from the finished rounds under the same rules. No round is added because a result looks close.

    Rehearsal. All four shapes and all fifteen paths run 2 rounds at 20,000 rows first. It checks the setup and is never read as a result. A shape whose rehearsal fails a check is not run.

    Reruns and changes. A read verdict is final, including "not resolved". After WEAK or INVALID, one unchanged rerun replaces only the figures that reported nothing. A change of paths, sizes, thresholds, or pins after a timed run is a new study with a new comment first.

    Limits.

    • One laptop, relative figures only.
    • The database files are warm in the page cache (the copy is made right before each process), and every figure but a one-call figure is a warm call.
    • The vector read paths at 100,000 rows and above are covered by the 128-dimension shape, not the 768-dimension one.
    • Native against JVM compares two runtimes on one engine version. No single change is measured, and no figure is compared or pooled with my earlier runs on older wheels.

    (Edited 2026-12-05: the kit checksum above. The rehearsal stopped because the identity check did not accept the version a development wheel reports (26.12.1-SNAPSHOT), so I changed that one check and nothing else; the rules are as before, and no timed run had started.)

  8. tae898 commented on Dec 5, 2026

    @tae898
    CollaboratorAuthor

    I corrected the kit checksum in the rules above and marked the edit at its end. The rehearsal had stopped on a version check, nothing else changed, and no timed run has started.

  9. tae898 commented on Dec 5, 2026

    @tae898
    CollaboratorAuthor

    The first full run of this study could not be read: the strict rule dropped almost every pair because the other compare lane was busy (details in tae898/humem-ops#767). Before any rerun, this is the rule that will apply. It changes only how load from an accepted sibling compare lane is treated.

    Amended OTHER-BENCH rule for the paired scorer (humem-ops#767, decided 2026-12-05)

    The strict rule of 2026-10-26 dropped a pair when benchmark-class load ran on cores outside the arm's own cores. One case is amended: load that is pinned inside the cores of another accepted compare lane of the same host is no longer a reason to drop a pair. Nothing else about the rule changes.

    1. What counts as a sibling lane. A lane of class compare in the host profile (worker.toml, [lanes]) while accepted_compare_lanes is 2 or more. On the laptop that is compare1 (cores 6,7) and compare2 (cores 10,11). A process counts as inside a lane when its whole Cpus_allowed_list lies inside that lane's cores. A process that is not pinned inside a lane (an agent, a build, a solo or bulk job, a desktop program, an unpinned process) is not a sibling.
    2. What the sampler records. Per 5 s sample, other_bench_sibling_cores (CPU of sibling-lane load, in cores), other_bench_sibling_lanes (lane to cores) and other_bench_sibling_roots. The load also stays inside other_bench_cores, so a scorer without this rule reads the sample as before. A sample without these fields is read exactly as under the strict rule.
    3. What the scorer drops. A pair is dropped when other_bench_cores - other_bench_sibling_cores is above 0.5 cores in the window of either arm (window and threshold unchanged). The drop names only the roots that are not on a sibling lane. Load on any other cores still drops the pair, also when sibling load is present at the same time.
    4. What the scorer prints. SIBLING-LANE: k round(s) overlapped an accepted compare lane, kept [rounds] (a round counts when any sample in its window has sibling load). No pair is dropped for it and the verdict is not forced weak. COLLISION, NOISY, THROTTLE, TEMP and their output are unchanged.
    5. What decides whether the neighbour mattered. The A/A control (Z against A) of each unit, scored with the same rules, so the same neighbour is present in it. A unit whose A/A control is outside its band stays INVALID, as before, and is not read. The per-row noise stays in the output.
    6. Kits. A kit's ab.py stays frozen. A kit is changed only by regenerating its ab.py from the new source and refreshing its SHA256SUMS, which makes it a new kit. Results already produced with the strict rule are not rescored.
  10. tae898 commented on Dec 5, 2026

    @tae898
    CollaboratorAuthor

    I am writing the rules of this measurement down before its first run.

    Question. For each way of reading a query result from Python, how fast is the native wheel (arcadedb) against the JVM wheel (arcadedb-jvm) on 26.12.1.dev2, which read API should I recommend for each wheel, and is any path far enough behind on one wheel to be worth a fix?

    Arm wheel role
    A arcadedb 26.12.1.dev2 (native) reference
    B arcadedb-jvm 26.12.1.dev2 compared
    Z A again A/A control

    Each run is one fresh process on a fresh copy of a database of 1,000,000 documents. A call is SELECT <all columns> FROM D LIMIT n plus the read path, timed until the caller has the result. A figure is the median of the calls after the first (12 calls under 0.02 s, 6 under 0.2 s, 3 under 2 s, else the one call). Four table shapes: narrow (4 scalar columns), wide (50 columns), and the 4 scalar columns with a 128-dimension or a 768-dimension vector. Row counts 1,000, 100,000, and 1,000,000. The 100,000 and 1,000,000 figures decide; the 1,000 figures are reported only.

    part read paths runs
    1 (main) first, iter_json_batches, to_arrow, to_columns, to_dataframe, to_json_list, to_polars (the seven whose figures stayed weak in my first run) 1, at most 2
    2 (rest) iter_dicts, to_list, list(rs), iterating with to_dict(), count, iterating with get, and the last two on record rows (SELECT FROM D) 1, at most 2

    Verdict. Per figure, the median of the per-round ratios native / JVM with a 95% bootstrap interval (10,000 resamples, seed 1). Below 1.00 the native wheel is faster.

    verdict condition
    no difference the interval lies inside [0.97, 1.03]
    not resolved the interval contains 1.00 and leaves that band
    native faster the upper end is below 1.00
    JVM faster the lower end is above 1.00

    An outlier is a read figure where one wheel is more than 1.5 times slower by the median, or a path that raises on one wheel only. A recommended read API for a wheel is the fastest row-returning and the fastest columnar path by median, for each table shape and row count, named only from figures that were read. A statement over several figures is made only if every figure in it passes on its own. Medians taken from two different runs are compared only as absolute times, and I will say so where I do. Peak memory and total time are reported and decide nothing.

    Pins, validity, throttle rule, repetitions, and limits

    Pins.

    What Pin
    native wheel, linux x86_64 sha256 2913537be9f3cef65a43ea8ff29d0f998dd115e8fb870b1d9c323b989ac2d6d9
    JVM wheel, linux x86_64 sha256 5fbbdf30d2b8e0ee69aefa9c0881bd62a2858c9904588fd44d58eb9f2d498dd8
    bindings commit 4b8a5b18ea7b54deac8fc7874248f691973133aa
    engine 26.12.1.dev2, one engine version and build commit in every run
    Python 3.12, numpy 2.5.4, pyarrow 26.0.0, pandas 3.1.0, polars 2.1.0, JPype1 1.7.1 (JVM arm only)
    heap JVM wheel: its default (half of the physical memory). Native wheel: the equal -Xmx, which is its default written out
    host my laptop (Core Ultra X9 388H, Linux), two pinned E cores, turbo on, powersave governor, editor, browser, and agent sessions held on other cores. The figures are relative only
    kit the checksum file of the scripts has sha256 e7ba9da0d6d6e005cfdfcb49150d2755603105df5819f655f552fbcf6707027d

    Grid. Row-returning paths run where rows times values per row is at most 150 million, columnar paths where it is at most 800 million. With the 768-dimension vector, the record-row, JSON, and columnar paths run at 1,000 rows only, because their projected peak memory on the JVM was above 12,000 MiB.

    Validity, checked before any verdict. A table shape is INVALID when a run did not use the wheel of its arm, a wheel version, commit, engine version, or engine build commit differs from the pins or between runs, the runs of one wheel did not all get the same maximum heap, the decoded first 20 rows differ between runs of the same wheel, or the throttle counters cannot be read. A run counts only when the table has 1,000,000 rows, a stored record equals the generator, and every call returned the right number of rows. A run that fails is left out and listed; a table shape stops after a failed run in its first round, or after 3 failed runs in a row. A difference between the wheels in the decoded rows is listed as a finding. A figure is INVALID when the A/A control has fewer than 10 clean pairs, or its interval excludes 1.00 and overlaps the interval of B against A, or another timed job overlapped. A figure is WEAK with fewer than 10 clean pairs of B against A, or with an interval wider than 0.10 times its median. INVALID and WEAK report no result.

    Throttle and interference rule. A run starts when the package is at most 70 C (after the first run of a round also at most 2 C above that run's start), after at most 180 s of waiting. A pair is dropped when the two runs' throttled share of the timed window (core throttle time of the two cores) differs by more than 1 percentage point, when their start temperatures differ by more than 5 C, or when my interference sampler marked either run (more than half a core of other work on a group of cores, other benchmark work, a camera, or a suspend).

    Repetitions and stopping. In a round, each table shape runs the three arms back to back, the order rotated and reversed from round to round. Rounds 0 to 12 (round 0 is dropped), then 2 more for a shape that has a weak or invalid figure, at most up to round 20. No round starts that is not expected to end 15 minutes before the 11-hour time limit of a run. A study that is not complete then goes on in the next run, at most 2 runs, and nothing is read between the runs. After the last run the verdict is read from the finished rounds under the same rules. No round is added because a result looks close.

    Rehearsal. All four shapes and all fifteen paths run 2 rounds at 20,000 rows first. It checks the setup and is never read as a result. A shape whose rehearsal fails a check is not run.

    Reruns and changes. A read verdict is final, including "not resolved". After WEAK or INVALID, one unchanged rerun replaces only the figures that reported nothing. A change of paths, sizes, thresholds, or pins after a timed run is a new study with a new comment first.

    Amended interference rule (humem-ops#767, 2026-12-05). The first full run of this study (kit 596deff5f85348958d797e99a23dc4cbca433cd4270bbef40128b8c0073f6ddc) could not be read: the strict rule above dropped a pair for any other benchmark load, so the load of the other compare lane on the same laptop (cores 10 and 11 beside my cores 6 and 7) removed almost every pair, and every gating figure came out WEAK with no clean pair. The rerun uses the same paths, sizes, thresholds, and pins. Only one case of the interference rule changes: load pinned wholly inside the cores of another accepted compare lane no longer drops a pair, and the scorer prints which rounds had it. Load on any other cores still drops the pair. The A/A control of each unit runs beside the same neighbour and still decides whether the figure is read. The kit with the new scorer has the checksum e7ba9da0d6d6e005cfdfcb49150d2755603105df5819f655f552fbcf6707027d. The rehearsal of the old kit is void, so the rehearsal is run again on the new kit, and the first run's outputs are kept and not rescored.

    Limits.

    • One laptop, relative figures only.
    • The database files are warm in the page cache (the copy is made right before each process), and every figure but a one-call figure is a warm call.
    • The vector read paths at 100,000 rows and above are covered by the 128-dimension shape, not the 768-dimension one.
    • Native against JVM compares two runtimes on one engine version. No single change is measured, and no figure is compared or pooled with my earlier runs on older wheels.
  11. tae898 commented on Dec 6, 2026

    @tae898
    CollaboratorAuthor

    The kit of this study changed after the rules above, so here is the checksum to compare against. The rule of the timed lock is now per core pair instead of one lock for the laptop (the reason is in my comment on #353), which gives the checksum file of the scripts the sha256 0ea653b2a4a3863dcda2998545029bf0dec1ab50be3bcc81fe85e3d7c0499168. A rehearsal on this kit (smoke2) finished on 2026-12-05 at 23:28 UTC, and the rerun main-r2-n1 started on compare1 at the same time and is running. The first full run, with the old kit 596deff5..., stays on disk and is not rescored.

  12. tae898 commented on Dec 6, 2026

    @tae898
    CollaboratorAuthor

    The decoded rows of to_json_list differ between the wheels for the vector shapes, and the cause is the age of the 26.12.1.dev2 JVM wheel

    The rules above say that a difference between the wheels in the decoded rows is listed as a finding. In the first full run it was listed for vec128 and vec768: the digest of the decoded first 20 rows of to_json_list is the same as to_list on the native wheel and not on the JVM wheel. I decoded the rows to see what differs. One table with a FLOAT column and an 8-value ARRAY_OF_FLOATS column, 20 rows of float32 values from numpy.random.default_rng(7000), to_list() against to_json_list() of the same query, elements read as Python floats and compared (a projection and a record row give the same counts):

    wheel column elements differ between to_list and to_json_list first element, to_list / to_json_list
    native dev2 FLOAT 20 0 -0.6260390877723694 / -0.6260390877723694
    native dev2 ARRAY_OF_FLOATS 160 0 -0.5107977390289307 / -0.5107977390289307
    jvm dev2 FLOAT 20 20 -0.6260390877723694 / -0.6260391
    jvm dev2 ARRAY_OF_FLOATS 160 160 -0.5107977390289307 / -0.51079774
    jvm post4 FLOAT 20 0 -0.6260390877723694 / -0.6260390877723694
    jvm post4 ARRAY_OF_FLOATS 160 0 -0.5107977390289307 / -0.5107977390289307

    So on arcadedb-jvm 26.12.1.dev2 to_json_list writes a float32 as its shortest decimal text (-0.51079774), where the native wheel and arcadedb-jvm 26.11.1.post4 give the exact double the float32 widens to. Both read back as the same float32. The cause is the age of the wheel, not a regression on main. The 26.12.1.dev2 wheels were uploaded to PyPI on 2026-11-07 from bindings commit 4b8a5b1, and main is 225 commits ahead of it (checked on 2026-12-06). The fix is #320 (commit dated 2026-11-09), and tests/test_cross_wheel_golden.py of main has two tests for it. I ran them against the installed wheels (-k floats): both fail on arcadedb-jvm==26.12.1.dev2 and both pass on arcadedb-jvm==26.11.1.post4.

    What it means here: the to_json_list figures of the JVM wheel on the vector shapes measure the path before #320, which is not the path of 26.12.1, so I will not read them as a statement about the release. The docs line "to_json_list() has no such difference for floats" agrees with 26.11.1.post4 and with the tests of main. Nothing is filed, because nothing is wrong on main.

  13. tae898 commented on Dec 6, 2026

    @tae898
    CollaboratorAuthor

    What this means for this study (follow-up to my limit comment above): #320 is the one that matters here: the difference in the decoded rows of to_json_list between the wheels that I described in my comment above is this old-wheel effect, which main already fixes.

    State: the second full run, main-r2-n1, has been running on compare1 since 2026-12-06 00:27 UTC. Next: once the final 26.12.1 wheels are on PyPI (there is only 26.12.1.dev2 so far), I will re-pin the same kit with its own fill.py pypi 26.12.1 and rerun what matters. The dev2 figures stay here as the pre-release baseline, and the result on the final wheels comes as its own comment.

    (Edited: removed the paragraph that repeated my limit comment above.)

  14. tae898 commented on Dec 6, 2026

    @tae898
    CollaboratorAuthor

    The second full run of this study is finished, and it could be read in part: of the 44 figures that decide (100,000 and 1,000,000 rows), 29 have a verdict and 15 stay unread. The rules and the amended scorer rule are in my comments above, and nothing in them changed. Wheels are 26.12.1.dev2, native arcadedb against arcadedb-jvm, kit checksum 0ea653b2..., run main-r2-n1 on compare1 (the declared rerun of part 1). Below 1.00 the native wheel is faster.

    table shape deciding figures read JVM faster native faster no difference or not resolved unread (weak)
    narrow 14 10 7 2 1 4
    wide 14 11 10 0 1 3
    vec128 14 6 2 4 0 8
    vec768 2 2 2 0 0 0
    all 44 29 21 6 2 15

    The A/A control (native against native) was valid everywhere: the scorer marked no table shape invalid and no run failed, the A/A interval of each of the 72 figures has 11 to 17 clean pairs, none had a collision, and the A/A intervals lie between 0.96 and 1.03. The figures that were read rest on 10 to 18 clean pairs each.

    What the read figures support, stated only where every figure in the statement was read on its own:

    • to_arrow, to_columns, to_dataframe and to_polars at 1,000,000 rows: the JVM wheel is faster in all four. Native / JVM is 2.14 to 3.11 on narrow and 2.08 to 3.79 on wide (lowest to highest median of the four).
    • first at 1,000,000 rows: the JVM wheel is faster on all four table shapes, native / JVM 1.29 to 12.05. The call returns one row: the slowest median is 7.02 ms on the native wheel and 0.637 ms on the JVM wheel.
    • The other paths are in the table in the details. The rest of this comment is what stays open.

    Not read: 15 figures, each reported interval wider than 0.10 x median after the rerun. The rules allow one unchanged rerun for such figures and this was it, so they stay unread and I will not rerun them unchanged. A run that tries again needs a changed rule or a stated reason posted here first. Not run yet: part 2 (rest, the eight other read paths). The to_json_list decoded-rows difference on the vector shapes (vec128 and vec768) is the old-wheel effect I described above. The final 26.12.1 wheels are the next run, as its own comment.

    Every read deciding figure, the unread list, and limits
    figure native / JVM [95% interval] clean pairs verdict
    narrow/first_100k 1.15 [1.07, 1.18] 14 JVM faster
    narrow/first_1M 1.29 [1.23, 1.31] 14 JVM faster
    narrow/iter_json_batches_100k 0.93 [0.90, 0.94] 14 native faster
    narrow/iter_json_batches_1M 1.03 [1.02, 1.05] 14 JVM faster
    narrow/to_arrow_1M 3.11 [3.03, 3.22] 14 JVM faster
    narrow/to_columns_1M 2.47 [2.43, 2.52] 14 JVM faster
    narrow/to_dataframe_1M 2.14 [2.11, 2.20] 14 JVM faster
    narrow/to_json_list_100k 0.85 [0.82, 0.87] 14 native faster
    narrow/to_json_list_1M 0.99 [0.98, 1.02] 14 no difference
    narrow/to_polars_1M 3.04 [2.99, 3.21] 14 JVM faster
    wide/first_1M 12.05 [11.36, 12.35] 18 JVM faster
    wide/iter_json_batches_100k 1.05 [1.04, 1.06] 18 JVM faster
    wide/iter_json_batches_1M 1.09 [1.07, 1.10] 18 JVM faster
    wide/to_arrow_1M 3.79 [3.65, 3.85] 18 JVM faster
    wide/to_columns_100k 2.88 [2.79, 2.95] 18 JVM faster
    wide/to_columns_1M 3.29 [3.25, 3.34] 18 JVM faster
    wide/to_dataframe_100k 1.95 [1.84, 2.01] 18 JVM faster
    wide/to_dataframe_1M 2.08 [2.02, 2.13] 18 JVM faster
    wide/to_json_list_100k 0.98 [0.97, 1.00] 18 not resolved
    wide/to_json_list_1M 1.10 [1.08, 1.11] 18 JVM faster
    wide/to_polars_1M 3.72 [3.61, 3.82] 18 JVM faster
    vec128/first_100k 3.05 [2.93, 3.14] 17 JVM faster
    vec128/first_1M 3.51 [3.27, 3.57] 17 JVM faster
    vec128/iter_json_batches_100k 0.25 [0.25, 0.25] 17 native faster
    vec128/iter_json_batches_1M 0.31 [0.30, 0.31] 17 native faster
    vec128/to_json_list_100k 0.22 [0.22, 0.23] 17 native faster
    vec128/to_json_list_1M 0.20 [0.20, 0.21] 17 native faster
    vec768/first_100k 8.55 [8.13, 8.62] 10 JVM faster
    vec768/first_1M 8.70 [8.55, 8.93] 10 JVM faster

    Unread (weak): narrow/to_arrow_100k, narrow/to_columns_100k, narrow/to_dataframe_100k, narrow/to_polars_100k, vec128/to_arrow_100k, vec128/to_arrow_1M, vec128/to_columns_100k, vec128/to_columns_1M, vec128/to_dataframe_100k, vec128/to_dataframe_1M, vec128/to_polars_100k, vec128/to_polars_1M, wide/first_100k, wide/to_arrow_100k, wide/to_polars_100k.

    19 of the read figures are outliers by the rules (one wheel more than 1.5 times slower by the median); they are in analysis.txt of the run. Figures at 1,000 rows are reported only and are not in this table. Medians of this run are not pooled with the first run, which was not read under the strict rule. One laptop, relative figures only; the limits of the rules above hold.

  15. tae898 commented on Dec 6, 2026

    @tae898
    CollaboratorAuthor

    I am running part 1 of this study again on the same 26.12.1.dev2 wheels on another laptop lane (compare4), to read the 15 deciding figures that stayed unread. The rules below are the full text of that run, fixed before its first timed run, with the new kit checksum and the reason for a new run in the paragraph that starts "Third run on the same wheels".

    I am writing the rules of this measurement down before its first run.

    Question. For each way of reading a query result from Python, how fast is the native wheel (arcadedb) against the JVM wheel (arcadedb-jvm) on 26.12.1.dev2, which read API should I recommend for each wheel, and is any path far enough behind on one wheel to be worth a fix?

    Arm wheel role
    A arcadedb 26.12.1.dev2 (native) reference
    B arcadedb-jvm 26.12.1.dev2 compared
    Z A again A/A control

    Each run is one fresh process on a fresh copy of a database of 1,000,000 documents. A call is SELECT <all columns> FROM D LIMIT n plus the read path, timed until the caller has the result. A figure is the median of the calls after the first (12 calls under 0.02 s, 6 under 0.2 s, 3 under 2 s, else the one call). Four table shapes: narrow (4 scalar columns), wide (50 columns), and the 4 scalar columns with a 128-dimension or a 768-dimension vector. Row counts 1,000, 100,000, and 1,000,000. The 100,000 and 1,000,000 figures decide; the 1,000 figures are reported only.

    part read paths runs
    1 (main) first, iter_json_batches, to_arrow, to_columns, to_dataframe, to_json_list, to_polars (the seven whose figures stayed weak in my first run) 1, at most 2
    2 (rest) iter_dicts, to_list, list(rs), iterating with to_dict(), count, iterating with get, and the last two on record rows (SELECT FROM D) 1, at most 2

    Verdict. Per figure, the median of the per-round ratios native / JVM with a 95% bootstrap interval (10,000 resamples, seed 1). Below 1.00 the native wheel is faster.

    verdict condition
    no difference the interval lies inside [0.97, 1.03]
    not resolved the interval contains 1.00 and leaves that band
    native faster the upper end is below 1.00
    JVM faster the lower end is above 1.00

    An outlier is a read figure where one wheel is more than 1.5 times slower by the median, or a path that raises on one wheel only. A recommended read API for a wheel is the fastest row-returning and the fastest columnar path by median, for each table shape and row count, named only from figures that were read. A statement over several figures is made only if every figure in it passes on its own. Medians taken from two different runs are compared only as absolute times, and I will say so where I do. Peak memory and total time are reported and decide nothing.

    Third run on the same wheels, turbo off (2026-12-06). The second full run (main-r2-n1, kit 0ea653b2a4a3863dcda2998545029bf0dec1ab50be3bcc81fe85e3d7c0499168) read 29 of the 44 deciding figures, and 15 stayed unread. This run repeats part 1 (main) on the same paths, sizes, thresholds, and 26.12.1.dev2 wheels, under the amended interference rule above, in a new kit with the checksum 6999af9092a0d17fa0f5fb6211ffeecb902fb4d4c4062420c156ac5e41437bf4, on the compare lane compare4 (cores 10 and 11). The laptop now runs with turbo off, which is a change of the host after a timed run, so this is a new study and this comment comes first. Its figures stand beside the second run: the 29 verdicts already read there stay as they are, and this run is read for the figures that stayed unread. Absolute times of the two runs are not compared.

    Pins, validity, throttle rule, repetitions, and limits

    Pins.

    What Pin
    native wheel, linux x86_64 sha256 2913537be9f3cef65a43ea8ff29d0f998dd115e8fb870b1d9c323b989ac2d6d9
    JVM wheel, linux x86_64 sha256 5fbbdf30d2b8e0ee69aefa9c0881bd62a2858c9904588fd44d58eb9f2d498dd8
    bindings commit 4b8a5b18ea7b54deac8fc7874248f691973133aa
    engine 26.12.1.dev2, one engine version and build commit in every run
    Python 3.12, numpy 2.5.4, pyarrow 26.0.0, pandas 3.1.0, polars 2.1.0, JPype1 1.7.1 (JVM arm only)
    heap JVM wheel: its default (half of the physical memory). Native wheel: the equal -Xmx, which is its default written out
    host my laptop (Core Ultra X9 388H, Linux), two pinned E cores, turbo off, powersave governor, editor, browser, and agent sessions held on other cores. The figures are relative only
    kit the checksum file of the scripts has sha256 6999af9092a0d17fa0f5fb6211ffeecb902fb4d4c4062420c156ac5e41437bf4

    Grid. Row-returning paths run where rows times values per row is at most 150 million, columnar paths where it is at most 800 million. With the 768-dimension vector, the record-row, JSON, and columnar paths run at 1,000 rows only, because their projected peak memory on the JVM was above 12,000 MiB.

    Validity, checked before any verdict. A table shape is INVALID when a run did not use the wheel of its arm, a wheel version, commit, engine version, or engine build commit differs from the pins or between runs, the runs of one wheel did not all get the same maximum heap, the decoded first 20 rows differ between runs of the same wheel, or the throttle counters cannot be read. A run counts only when the table has 1,000,000 rows, a stored record equals the generator, and every call returned the right number of rows. A run that fails is left out and listed; a table shape stops after a failed run in its first round, or after 3 failed runs in a row. A difference between the wheels in the decoded rows is listed as a finding. A figure is INVALID when the A/A control has fewer than 10 clean pairs, or its interval excludes 1.00 and overlaps the interval of B against A, or another timed job overlapped. A figure is WEAK with fewer than 10 clean pairs of B against A, or with an interval wider than 0.10 times its median. INVALID and WEAK report no result.

    Throttle and interference rule. A run starts when the package is at most 70 C (after the first run of a round also at most 2 C above that run's start), after at most 180 s of waiting. A pair is dropped when the two runs' throttled share of the timed window (core throttle time of the two cores) differs by more than 1 percentage point, when their start temperatures differ by more than 5 C, or when my interference sampler marked either run (more than half a core of other work on a group of cores, other benchmark work, a camera, or a suspend).

    Repetitions and stopping. In a round, each table shape runs the three arms back to back, the order rotated and reversed from round to round. Rounds 0 to 12 (round 0 is dropped), then 2 more for a shape that has a weak or invalid figure, at most up to round 20. No round starts that is not expected to end 15 minutes before the 11-hour time limit of a run. A study that is not complete then goes on in the next run, at most 2 runs, and nothing is read between the runs. After the last run the verdict is read from the finished rounds under the same rules. No round is added because a result looks close.

    Rehearsal. All four shapes and all fifteen paths run 2 rounds at 20,000 rows first. It checks the setup and is never read as a result. A shape whose rehearsal fails a check is not run.

    Reruns and changes. A read verdict is final, including "not resolved". After WEAK or INVALID, one unchanged rerun replaces only the figures that reported nothing. A change of paths, sizes, thresholds, or pins after a timed run is a new study with a new comment first.

    Amended interference rule (humem-ops#767, 2026-12-05). The first full run of this study (kit 596deff5f85348958d797e99a23dc4cbca433cd4270bbef40128b8c0073f6ddc) could not be read: the strict rule above dropped a pair for any other benchmark load, so the load of the other compare lane on the same laptop (cores 10 and 11 beside my cores 6 and 7) removed almost every pair, and every gating figure came out WEAK with no clean pair. The rerun uses the same paths, sizes, thresholds, and pins. Only one case of the interference rule changes: load pinned wholly inside the cores of another accepted compare lane no longer drops a pair, and the scorer prints which rounds had it. Load on any other cores still drops the pair. The A/A control of each unit runs beside the same neighbour and still decides whether the figure is read. The kit with the new scorer has the checksum 6999af9092a0d17fa0f5fb6211ffeecb902fb4d4c4062420c156ac5e41437bf4. The rehearsal of the old kit is void, so the rehearsal is run again on the new kit, and the first run's outputs are kept and not rescored.

    Limits.

    • One laptop, relative figures only.
    • The database files are warm in the page cache (the copy is made right before each process), and every figure but a one-call figure is a warm call.
    • The vector read paths at 100,000 rows and above are covered by the 128-dimension shape, not the 768-dimension one.
    • Native against JVM compares two runtimes on one engine version. No single change is measured, and no figure is compared or pooled with my earlier runs on older wheels.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementjvmnativeperformancepython

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions