This repository was archived by the owner on Nov 21, 2026. It is now read-only.
Repository navigation
Conversation
… path Counts the calls into the JVM of Document.get_raw, ResultSet.one() and count(), lookup_by_key and the transaction-stack mark, and pins that each answer, error and result-set state equals the plain path's. These fail on main: that is the change they ask for. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…has() then get() get() answers null for a property the record does not have, as it does for one set to null; Python reads None either way, so the has() call only repeated the scan. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…st() one() read hasNext()/next() per row and closed afterwards; count() crossed twice per row. upToTwoAndClose and countAndClose do the same work Java-side with the same errors and the same result-set state, and the plain path stays for a missing bridge class. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…no Java arrays DbCalls.lookupFirstKey takes one key as scalars and lookupFirstKeys takes any number as the varargs of one call, so neither side builds a String[] and an Object[] per lookup. The engine receives the same arrays, and a different number of names and values reaches it as before. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The mark taken before every begin() (with db.transaction(), run_in_transaction) asked isTransactionActive() and getNestedTransactions() separately. DbCalls.stackMark returns both as one number. The mark is still taken before begin(), so the interrupt and refused-begin rules of ArcadeData#9970 and ArcadeData#9813 are unchanged. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Oct 25, 2026
Author
|
Closing here: the bindings moved to ArcadeData/arcadedb-python. The branch stays for the queued A/B jvm-readpath-glue-ab-laptop-20261025; if it passes, the change is ported there. |
This was referenced Nov 3, 2026
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 JVM wheel's read path crossed into the JVM several times per operation; a JPype call is a few microseconds of dispatch, and an untimed async-profiler pass (CPU samples of the Python-driven threads, main wheel) put 10.7% of a warm point-read workload in JNI/libjvm and 5.2% in JPype C++ besides 5.4% of Java glue. This PR cuts the number of crossings of five common calls, each as its own commit, with the answer, the errors and the result-set state unchanged.
What changes (crossings per call, counted by the new tests on a proxy of the Java object and the bridge classes; the tests that count fail on main and pass here)
Document.get_raw()(soget(),Vertex.get(),Edge.get()): 2 crossings and 2 scans of the record (has()thenget()) become 1 crossing and 1 scan.get()answers null for a property the record does not have, as it does for one set to null, and Python reads None either way;has_property()still tells the two apart (tests for absent, null-valued, mutable, vertex and edge).ResultSet.one():RowAccess.upToTwoAndClosereturns the first two rows and closes the set in one call, where the loop tookhasNext()/next()per row plus the close (4 crossings for a single row by reading the code). Zero rows, several rows, an error while reading and a closed database raise the same exceptions and leave the same_closed/_exhaustedstate as the plain path, which stays for a missing bridge class.ResultSet.count():RowAccess.countAndClosecounts the rows left and drains and closes the set in one call, where the loop crossed twice per row. A statement error surfaces as before and leaves the set open for the caller.Database.lookup_by_key(): it was already one crossing, but built aString[]and anObject[]through JPype first.DbCalls.lookupFirstKeytakes one key as scalars andlookupFirstKeystakes any number as the varargs of one call (names then values, so a different number of names and values reaches the engine as before).lookupFirst, which takes the arrays, stays.begin():DbCalls.stackMarkreturns active and nesting depth as one number, sowith db.transaction()goes from 4 crossings to 3 andrun_in_transaction()from 6 to 5. The mark is still taken beforebegin(), so the interrupt and refused-begin rules of An interrupt duringbegin()inside a caller's own transaction leaves the nested transaction on the stack, so the caller's next commit commits an empty level and leaves their work uncommitted ArcadeData/arcadedb#9970, Two Python binding defects closed without a fix: run_in_transaction leaks a transaction and start() does not survive a Ctrl-C ArcadeData/arcadedb#9813 and db.transaction(...) retry re-applies the durable half of a statement that committed mid-execution (BATCH n, TRUNCATE TYPE) ArcadeData/arcadedb#7916 are unchanged.Tests
bindings/python/tests/test_read_crossings.py(21 tests: crossing counts plus equivalence with the plain path, including typed and composite keys, error cases and the engine's own stack numbers). On the main wheel 9 of them fail (the counts) and 12 pass (the equivalence); on this branch's wheel all 21 pass, and so dotest_percall_calls,test_resultset,test_resultset_read_errors,test_results_after_close,test_run_in_transaction_retry,test_transaction_context_interrupt,test_transaction_config,test_graph_api,test_core,test_concurrencyandtest_cross_model_atomicity(232 passed, 10 skipped there). They ran against the main CI wheel with only the changed Python files and a bridge jar rebuilt from these sources.docs/development/bridge.mdlists the new entry points.What was measured and what was not Only untimed crossing counts. No speed claim is made here: a timed ABBA A/B of the main wheel against this branch on the benchmark laptop (point reads,
one(),Document.get, small transactions and a 4-thread mixed window, with an A/A control and a rule written before the first timed run) is queued, and this PR is not to be merged on the counts alone. The transaction commit saves one crossing of a few microseconds next to a commit of tens of microseconds, so it may not show; the rule treats it separately.🤖 Generated with Claude Code