Skip to content

bindings-ab: port the ingest, UDF and callback arms to the release wheels and run the A/B #353

Open

Description

@tae898

Problem

The long bindings A/B study still measures an old humemai cp312 wheel. The result applies to old code, so it cannot support a claim about the shipped arcadedb and arcadedb-jvm wheels.

I want one A/A pair per tier family and package in the plan, so every verdict carries its own noise floor, and the study runs last in the timed queue.

Priority: P4.

Acceptance

  • Only the ingest (dataframe, Arrow, columns), UDF and callback arms are ported to the arcadedb and arcadedb-jvm 26.12.1 wheels (import name arcadedb), the materialize arm is dropped
  • The A/A pairs are in the plan and the checksums are refreshed
  • A dry run at small N passes and the estimate is refreshed
  • The study runs and its verdict is recorded

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-23: the study now measures on the 26.12.1 wheels, see #315.)

Activity

  1. added
    python
    performance
    on Nov 10, 2026
  2. added
    jvm
    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. added
    enhancement
    on Dec 2, 2026
  6. 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 timed run.

    Question. On the arcadedb (native) and arcadedb-jvm wheels at 26.12.1.dev2, what do the bulk ingest paths (insert_columns, insert_dataframe with pandas and polars, insert_arrow, insert_many), the registration modes of a Python function in SQL (register_function), and the record callbacks (db.on) cost against each other? Declared property types and the batch size of insert_dataframe are measured the same way.

    Each pair is one comparison on one wheel: A is the reference, B the compared arm, and the figure is the wall time of the call. For ingest it is total, the call plus the conversion an arm needs that the others do not (insert_columns on a datetime column converts it to Python datetimes first, because the JVM bridge refuses datetime64). The containers (data frame, Arrow table, column dict, row dicts) are built before the clock. The two wheels are scored separately and never in one ratio. 40 pairs per wheel, 3 of them A/A controls (the same arm on both sides) that give each family its own noise floor: ingest (insert_columns against itself, tier 1, also the control of tier 3), UDF (python_function against itself), callbacks (none against itself).

    tier what A (reference) B (compared) arguments
    1 ingest (A/A control) insert_columns insert_columns --rows 1000000 --shape mixed
    2 UDF (A/A control) python_function python_function --mode select --rows 1000000
    5 callbacks (A/A control) none none --rows 1000000 --via insert_many
    1 ingest insert_columns insert_dataframe_pandas --rows 1000000 --shape numeric
    1 ingest insert_columns insert_dataframe_polars --rows 1000000 --shape numeric
    1 ingest insert_columns insert_arrow --rows 1000000 --shape numeric
    1 ingest insert_many insert_dataframe_pandas --rows 1000000 --shape numeric
    1 ingest insert_dataframe_pandas insert_dataframe_polars --rows 1000000 --shape numeric
    1 ingest insert_columns insert_dataframe_pandas --rows 1000000 --shape mixed
    1 ingest insert_columns insert_dataframe_polars --rows 1000000 --shape mixed
    1 ingest insert_columns insert_arrow --rows 1000000 --shape mixed
    1 ingest insert_many insert_dataframe_pandas --rows 1000000 --shape mixed
    1 ingest insert_dataframe_pandas insert_dataframe_polars --rows 1000000 --shape mixed
    1 ingest insert_columns insert_dataframe_pandas --rows 1000000 --shape temporal
    1 ingest insert_columns insert_dataframe_polars --rows 1000000 --shape temporal
    1 ingest insert_columns insert_arrow --rows 1000000 --shape temporal
    1 ingest insert_many insert_dataframe_pandas --rows 1000000 --shape temporal
    1 ingest insert_dataframe_pandas insert_dataframe_polars --rows 1000000 --shape temporal
    2 UDF python_function sql_expression --mode select --rows 100000
    2 UDF python_function python_function_det --mode select --rows 100000
    2 UDF python_function sql_expression --mode where --rows 100000
    2 UDF python_function python_function_det --mode where --rows 100000
    2 UDF python_function sql_expression --mode select --rows 1000000
    2 UDF python_function python_function_det --mode select --rows 1000000
    2 UDF python_function sql_expression --mode where --rows 1000000
    2 UDF python_function python_function_det --mode where --rows 1000000
    3 ingest, declared types and batch size insert_dataframe_pandas insert_dataframe_pandas+declared --rows 1000000 --shape numeric
    3 ingest, declared types and batch size insert_columns insert_columns+declared --rows 1000000 --shape numeric
    3 ingest, declared types and batch size insert_dataframe_pandas insert_dataframe_pandas+declared --rows 1000000 --shape mixed
    3 ingest, declared types and batch size insert_columns insert_columns+declared --rows 1000000 --shape mixed
    3 ingest, declared types and batch size insert_dataframe_pandas insert_dataframe_pandas+declared --rows 1000000 --shape temporal
    3 ingest, declared types and batch size insert_columns insert_columns+declared --rows 1000000 --shape temporal
    3 ingest, declared types and batch size insert_dataframe_pandas@bs10000 insert_dataframe_pandas@bs1000 --rows 1000000 --shape numeric
    3 ingest, declared types and batch size insert_dataframe_pandas@bs10000 insert_dataframe_pandas@bs50000 --rows 1000000 --shape numeric
    5 callbacks none after_create_noop --rows 1000000 --via insert_many
    5 callbacks none before_create_noop --rows 1000000 --via insert_many
    5 callbacks none before_create_veto_none --rows 1000000 --via insert_many
    5 callbacks none after_create_noop --rows 1000000 --via insert_columns
    5 callbacks none before_create_noop --rows 1000000 --via insert_columns
    5 callbacks none before_create_veto_none --rows 1000000 --via insert_columns

    Every run is one fresh Python process on one wheel: it generates the data from a seed, runs the arm, checks the answer (counts and sums, floats to 1e-6), and prints the figure. The materialize arm is not part of this study (result transport has its own study).

    Verdict. Per pair and wheel, the median of the per-round ratios B / A (above 1.00 means B costs more) with a 95% bootstrap interval (10,000 resamples, seed 1). The deciding figure is total for the ingest pairs and seconds for the UDF and callback pairs. Every other figure is reported only.

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

    A verdict stands only with at least 12 clean pairs and no collision with another timed job. Every pair is its own claim: I make no sentence about "columnar wins everywhere" unless each pair it names passes on its own. A pair whose arm was chosen on a ground other than speed (for example declared types for schema safety) is called no worse only if the lower end of its interval for the adopted arm is at most 1.03.

    A/A rule. The A/A pair of a family and wheel is judged by the same validity rules as every pair. An A/A control is clean when its interval lies inside [0.97, 1.03], and noisy otherwise. A pair of its family is reported only if the A/A control is clean, or the pair's interval lies wholly outside the A/A control's interval. Otherwise it reports nothing. An invalid or weak A/A control makes every pair of its family on that wheel report nothing.

    Pins, validity, interference rule, repetitions, and limits

    Pins.

    What Pin
    native wheel arcadedb, linux x86_64 sha256 2913537be9f3cef65a43ea8ff29d0f998dd115e8fb870b1d9c323b989ac2d6d9
    JVM wheel arcadedb-jvm, linux x86_64 sha256 5fbbdf30d2b8e0ee69aefa9c0881bd62a2858c9904588fd44d58eb9f2d498dd8
    bindings commit 4b8a5b18ea7b54deac8fc7874248f691973133aa
    engine 26.12.1.dev2, one build in every run
    Python 3.12, JPype1 1.7.1 (JVM wheel only), numpy, pandas, polars, pyarrow, psutil at the versions of config.env
    settings every setting is the wheel's default. Heap: the JVM wheel's default (half of the physical memory); the native wheel gets the equal -Xmx, which is its default written out. insert_many and insert_columns get commit_every=10000 and the dataframe and Arrow arms a batch size of 10,000 on both wheels (the native default of insert_many is 1,000, the JVM default 10,000)
    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 c13961d6e0403f21d755c8de32ce702f1298f4a3ce97c892458b9f3199c0cf17

    Validity, checked before any verdict. A pair is INVALID when a run did not report the wheel of its package, when a wheel pin differs from the unzipped files, when three runs in a row printed no result, or when another timed job overlapped a round (collision, from my interference sampler). A run counts only when its answer check passed. A pair is WEAK with fewer than 12 clean pairs at the round cap. INVALID and WEAK pairs report nothing and stay on disk with their reason.

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

    Repetitions and stopping. Rounds 0 to 12 for every pair (round 0 is warm-up and dropped), the two arms in alternating order (A then B, B then A), then one more round at a time while the deciding figure has fewer than 12 clean pairs, at most up to round 20. No round starts after the time limit of a run (11 hours); the study goes on in the next run, at most 3 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. Every pair runs on both wheels for 2 rounds at 20,000 and 5,000 rows first. It checks the setup and is never read as a result.

    Reruns and changes. A read verdict is final, including "not resolved". A change of pairs, sizes, thresholds, or pins after a timed run is a new study with a new comment first. A rerun after INVALID or WEAK is announced with its own comment before it starts.

    Limits.

    • Ingest and callbacks run at 1,000,000 rows, UDF at 100,000 and 1,000,000 rows, one thread, one host.
    • The A/A control of a family is one pair of one shape and size. The noise floor of another shape or size in that family may differ.
    • Native against JVM is not compared here: each wheel is a separate set of pairs.
    • One laptop, relative figures only.
  7. tae898 commented on Dec 5, 2026

    @tae898
    CollaboratorAuthor

    Status of the main run of this study: the first main-n1 on compare1 did not measure anything. It waited 30 minutes for laptop-timed.lock and was refused, because the vector-wheels run on compare2 held the same lock. That lock was one file for the whole laptop, which stops the two compare lanes from running together.

    I changed the three affected kits (bindings-ab, reopen-first-query, result-transport, all 2612dev2) so the lock is per core pair (laptop-timed-6-7.lock for compare1), which changes each kit hash. The study is queued again behind a new smoke2, then main-n1. No result from the refused run is used.

  8. tae898 commented on Dec 6, 2026

    @tae898
    CollaboratorAuthor

    The kit of this study changed with the lock change in my comment above, so the checksum file of the scripts is now sha256 f78f48b9f9d094dca1b1216eef5852168f12fdbdbeded4611432b24c87b518d2 (the rules above give c13961d6...). The rehearsal that passed was on the old kit, so it is run again as smoke2 before main-n1, and both wait in the queue on compare1. The refused first main-n1 is not used.

  9. tae898 commented on Dec 6, 2026

    @tae898
    CollaboratorAuthor

    A limit of this study that I found while checking its wheel pins. 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). So they lack the glue changes merged after that date, for example #320 (the exact float of to_json_list on the JVM wheel) and #391 and #392 (typed columns on the JVM wheel). The figures of this study are for that code, and the repeat on the final 26.12.1 wheels stays necessary.

  10. tae898 commented on Dec 6, 2026

    @tae898
    CollaboratorAuthor

    What this means for this study (follow-up to my limit comment above): The insert_many arms and the callback pairs that load through insert_many are the ones #392 touches on the JVM wheel.

    State: queued on compare1 (smoke2, then main-n1), nothing timed yet. 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.)

  11. added
    native
    on Dec 6, 2026
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