GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — Native: record ids go to the engine as a parameter, not in the statement text by tae898 · Pull Request #202 · ArcadeData/arcadedb-python Conversation
|
| figure | median | 95% CI |
|---|---|---|
lookup_by_rid |
1.022 | [1.019, 1.025] |
get_out_edges('Knows') |
0.792 | [0.790, 0.794] |
Edge.get_in() |
0.792 | [0.789, 0.794] |
lookup_by_rid(...).modify(), set, save() |
0.805 | [0.801, 0.809] |
The pre-written rule dropped the PR because the lookup_by_rid headline got slower. This head therefore narrows the change to the paths that got faster and puts lookup_by_rid back to main's text. new_edge and delete() have no timed figure of their own; they follow the same pattern as the paths that were timed and are kept for that reason. A second run on the narrowed head, with its rule written before it, decides whether this leaves draft.
Untimed counts (25 records, tests/test_native_statement_texts.py, native only and not collected on JPype): lookup_by_rid still one text per record, as on main; get_out_edges("Knows"), get_in_edges() and get_both_edges() over the 24 linked vertices 72 calls and now 3 texts; Edge.get_in/get_out over 24 edges 48 calls and now 2 texts; save() and delete() one text each; new_edge two texts (with and without CONTENT) per label instead of one per pair. The behaviour tests added to tests/test_graph_api.py (traversal over a 12-vertex chain, save and delete by id, new_edge with and without properties, the refusals of lookup_by_rid) run on both builds.
The statement-cache finding was read from the engine source at 26f0bf889b (26.10.x); main now links a newer engine, so the text-count test is also the check that the engine still keeps a record id in a FROM target in the cache key. Draft PRs skip the test-native.yml legs, so the PR's wheel and the parity run come from gh workflow run test-native.yml --ref perf/native-rid-param. Checks run locally on the changed files: compile, pyflakes (only the findings main already has). The tests have not been run on this port; the parity run and the JVM legs are the first run.
🤖 Generated with Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ent text Port of humemai/arcadedb-embedded-python#529 (branch perf/native-rid-param, never merged there) onto current main. On the native build a record id was pasted into the SQL text, so each traversal step and each lookup_by_rid was a new statement text. The engine caches a parsed statement by its text (arcadedb.sqlStatementCache, 300 entries) and its literal parameterizer keeps a literal in a FROM target, so 25 records meant 25 cache entries. The id now goes over as a parameter (the RID the codec already tags as R): lookup_by_rid (SELECT FROM ?), Vertex.get_out_edges/get_in_edges/get_both_edges, Vertex.new_edge, Edge.get_in/get_out, save() (UPDATE :rid MERGE :row) and delete() (DELETE FROM :rid). Id validation and error messages are unchanged. test_native_statement_texts.py counts the distinct statement texts (native only, not collected on JPype); the new behaviour tests in test_graph_api.py run on both builds. Untimed counts only: a timed A/B decides it before merge. Refs #19 Co-Authored-By: Claude Opus 5.5 <[email protected]>
…2 % slower there First timed A/B (ab.py, laptop, native wheel of main vs this PR, 12 clean pairs): lookup_rid_us 1.022 [1.019, 1.025] (slower), out_edges_us 0.792 [0.790, 0.794], edge_ends_us 0.792 [0.789, 0.794], save_us 0.805 [0.801, 0.809] (faster). Guards flat, A/A clean. Narrow the PR to the paths that got faster; lookup_by_rid returns to main's text. database.py is now identical to main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Second timed A/B, on this narrowed head
Result: ok (all 6 B/A figures have >= 10 clean pairs and CI width <= 0.08, the A/A control is clean). Verdict by that rule: SHIP. The edge getters and edge ends are about a fifth faster and One figure to keep in view: |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…both native-only test ignores) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Conflicts resolved: - src/arcadedb/_native/records.py: keeps this branch's _save_update (lazy fingerprint, refuses a stale overwrite) and applies #202's rule inside it: the record id goes to the engine as the :rid parameter for both the stored-record read (_SELECT = "SELECT FROM :rid") and the UPDATE .. MERGE .. RETURN AFTER (_UPDATE now carries RETURN AFTER, which only _save_update uses). Without this, #202's test_native_statement_texts fails on the pasted ids in the save path. - tests/conftest.py, tests/test_graph_api.py: both sides appended; kept both. The duplicate `import pytest` from the two sides is dropped and main's import order kept (local isort disagrees with main's CI order; left as main has it). Co-Authored-By: Claude Opus 5.5 <[email protected]>
No textual conflicts: main's #202 (record ids as a :rid parameter, src/arcadedb/_native/records.py and database.py) and #201 (run_in_transaction witness) touch other hunks than this branch. The record-id rule of #202 is kept: this branch pastes no record id into SQL text (the lazy per-hit vector load, if present, goes through lookup_by_rid, which keeps its literal id by design, see tests/test_native_statement_texts.py). Static checks after the merge: compile() and pyflakes of the changed files (the unused typing.Optional in records.py is on main too), pre-commit black and isort pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
No textual conflicts: main's #202 (record ids as a :rid parameter, src/arcadedb/_native/records.py and database.py) and #201 (run_in_transaction witness) touch other hunks than this branch. The record-id rule of #202 is kept: this branch pastes no record id into SQL text (the lazy per-hit vector load, if present, goes through lookup_by_rid, which keeps its literal id by design, see tests/test_native_statement_texts.py). Static checks after the merge: compile() and pyflakes of the changed files (the unused typing.Optional in records.py is on main too), pre-commit black and isort pass. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.