Skip to content
This repository was archived by the owner on Nov 21, 2026. It is now read-only.
This repository was archived by the owner on Nov 21, 2026. It is now read-only.

Python bindings: per-call overhead of command(), query(), and the result wrapper #280

Closed

Description

@tae898

The Python bindings add a fixed cost to every Database.command() and query() call, on top of the JPype crossing and the engine. Measured on the laptop (P cores, official 26.10.1 wheel, JDK 25):

  • A per-row SQL INSERT with a vector parameter: JPype crossings about 6.5 us, to_java_float_array about 4.3 us, the ResultSet wrapper that is created and then closed by __del__ about 2 us. The parameter-map cost was already fixed by bindings: query()/command() parameters that hold a Java array take the short path #277.
  • A three-statement transaction: raw JPype 55 us against 70 us through the bindings, so about 16 us is the bindings layer.

Plan: profile command(), query(), begin(), commit(), and the result wrapper on small loops (one-row reads by key, one-row updates, single-row inserts with a vector, a three-statement transaction). For each cost, measure a trimmed Python path against a small Java glue method that does several steps in one crossing, and keep the faster one. Behaviour (results, exceptions, transaction semantics, overload choice) stays identical. The result and A/B table go in the PR, and the same change is applied to the tests, examples, and docs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions