You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reopen an existing database: first query and first vector query, native against JVM #355
enhancementNew feature or requestjvmThe arcadedb-jvm package (JPype build)nativeThe arcadedb package (native library build)performanceSpeed or memory of the bindings, with a measurementpythonPull requests that update python codevectorVector indexes and find_nearest
I want to know what opening an existing database plus the first query and the first vector query (lazy graph build) cost on each wheel, what warm-up advice follows, and what heap floor a reopen needs.
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 study is re-pinned to the 26.12.1 wheels and dry-run
It runs and is scored
Warm-up advice and a heap floor go into the docs
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.)
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: reopening four databases and running their first queries (the vector one with and without warm_up()), and a heap sweep for the smallest heap that works with a vector index.
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, so the re-pin and the dry run on 26.12.1 are still open.
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. What does it cost to reopen an existing database and run its first queries on the native wheel (arcadedb) and on the JVM wheel (arcadedb-jvm) at 26.12.1.dev2? Is calling warm_up() after the open worth it? What is the smallest heap with which a reopen with a vector index works?
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 that imports the wheel, opens a fresh copy of an existing database, runs one first query, then 100 more of the same kind, and closes it.
unit
database
first query
d1
100,000 documents, unique index
indexed point lookup
d2
1,000,000 documents, unique and non-unique index
indexed point lookup
d3
graph, 100,000 vertices and 500,000 edges
2-hop MATCH
d4
100,000 vectors of 768 dimensions with an LSM_VECTOR index (SQL defaults), and 100,000 documents
first find_nearest (k = 10), which loads or builds the vector graph
d4w
as d4
warm_up() first, then find_nearest
The deciding figures of every unit are the time to open (from before the import to the return of open_database), the time of the first query, and the peak memory of the process; d4w also the time of warm_up(). The other times and memory readings are reported only.
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, or smaller for memory. The value of a round is the median of 3 fresh processes per arm.
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 (smaller)
the upper end is below 1.00
JVM faster (smaller)
the lower end is above 1.00
Warm-up advice, per wheel, from medians: warm_up() is worth it if the first query of d4 takes more than 3 times its later queries, the first query after warm_up() takes at most 1.5 times its later queries, and warm-up plus that first query lie within 20% of the first query without warm-up.
Start-up advantage. I call the native start-up advantage erased by the first vector query only if the interval of the d4 time to the first answer, native / JVM, lies above 0.5.
Heap floor (untimed). d4 runs on both wheels with a maximum heap of 512 MB, 768 MB, 1 GB, 1.5 GB, 2 GB, and 3 GB, three runs each. The floor of a wheel is the smallest tested heap from which every run at it and at every larger tested heap passed its checks. I quote the error of a failed run. It is one data size, so it is a sizing point and not a formula.
Pins, validity, throttle rule, repetitions, and limits
26.12.1.dev2, one engine version and build commit in every run
Python
3.12, JPype1 1.7.1 (JVM arm only), numpy 2.5.4 (to build the databases only)
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
databases
built once, before the first timed run, by the pinned native wheel, and pinned by checksum
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 d85fe4a30b9a909287ff7c864db6e7cbeb7047f53082f4fefda5d0b45195df28
Validity, checked before any verdict. A unit 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, or the throttle counters cannot be read. A run counts only when all 101 answers are right (for d4 the stored vector asked for is the first hit in at least 95% of them), the record counts are right, and the query plan uses the index. A run that fails is left out and listed; a unit stops after a failed run in its first round, or after 3 failed runs in a row. A figure is INVALID when the A/A control has fewer than 10 clean pairs, when a difference is claimed while the A/A interval neither contains 1.00 nor lies inside [0.97, 1.03] and the interval of B against A does not lie wholly outside [0.90, 1.10], or when another timed job overlapped. A figure is WEAK with fewer than 10 clean pairs, 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 arms' 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 one (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 unit runs the three arms, each as 3 processes back to back, the order of the arms rotated and reversed from round to round. Rounds 0 to 12 (round 0 is dropped), then 2 more for a unit that has a weak figure, at most up to round 24. The heap runs follow d4 in rounds 0 to 2. 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 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. All units run 2 rounds at one fiftieth of the sizes first, heap runs included. It checks the setup and is never read as a result. A unit 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 units, sizes, thresholds, or pins after a timed run is a new study with a new comment first.
Limits.
The database files are warm in the page cache (the copy is made right before each process). This is not a first open after a reboot, and not a recovery after a crash.
Every database is written by the native wheel and read by both.
One size and one dimension for the vector index; no read-only open and no server mode.
One laptop, relative figures only. Native against JVM compares two runtimes on one engine version.
(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.)
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.
Status since the rules above. The kit changed twice after the first rehearsal. First the rehearsal was run again because its checksum changed, and it stopped on 2026-12-05 at 22:46 UTC. Then the timed lock became per core pair instead of one lock for the laptop (the reason is in my comment on #353). The checksum file of the scripts is now sha256 621d3c50e3bd51356584b67c98b141950ab8af79311c636a8bb655747911c3d6 (the rules above give d85fe4a3...). smoke2 and then main-n1 wait in the queue on compare1, and nothing has been timed for this study yet.
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.
What this means for this study (follow-up to my limit comment above): Judging by their titles these three change other paths than reopening a database and the first query, so I do not expect them to move this study; the other 222 commits I have not checked against it.
State: queued on compare1 (smoke2 next, 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.)
enhancementNew feature or requestjvmThe arcadedb-jvm package (JPype build)nativeThe arcadedb package (native library build)performanceSpeed or memory of the bindings, with a measurementpythonPull requests that update python codevectorVector indexes and find_nearest
Activity
tae898 commentedon Nov 27, 2026
I have prepared this measurement and written its rules down. It runs on the
26.12.1wheels once they are out, native against JVM with an A/A control: reopening four databases and running their first queries (the vector one with and withoutwarm_up()), and a heap sweep for the smallest heap that works with a vector index.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, so the re-pin and the dry run on
26.12.1are still open.tae898 commentedon Dec 5, 2026
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. What does it cost to reopen an existing database and run its first queries on the native wheel (
arcadedb) and on the JVM wheel (arcadedb-jvm) at 26.12.1.dev2? Is callingwarm_up()after the open worth it? What is the smallest heap with which a reopen with a vector index works?arcadedb26.12.1.dev2 (native)arcadedb-jvm26.12.1.dev2Each run is one fresh process that imports the wheel, opens a fresh copy of an existing database, runs one first query, then 100 more of the same kind, and closes it.
MATCHLSM_VECTORindex (SQL defaults), and 100,000 documentsfind_nearest(k = 10), which loads or builds the vector graphwarm_up()first, thenfind_nearestThe deciding figures of every unit are the time to open (from before the import to the return of
open_database), the time of the first query, and the peak memory of the process; d4w also the time ofwarm_up(). The other times and memory readings are reported only.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, or smaller for memory. The value of a round is the median of 3 fresh processes per arm.
Warm-up advice, per wheel, from medians:
warm_up()is worth it if the first query of d4 takes more than 3 times its later queries, the first query afterwarm_up()takes at most 1.5 times its later queries, and warm-up plus that first query lie within 20% of the first query without warm-up.Start-up advantage. I call the native start-up advantage erased by the first vector query only if the interval of the d4 time to the first answer, native / JVM, lies above 0.5.
Heap floor (untimed). d4 runs on both wheels with a maximum heap of 512 MB, 768 MB, 1 GB, 1.5 GB, 2 GB, and 3 GB, three runs each. The floor of a wheel is the smallest tested heap from which every run at it and at every larger tested heap passed its checks. I quote the error of a failed run. It is one data size, so it is a sizing point and not a formula.
Pins, validity, throttle rule, repetitions, and limits
Pins.
2913537be9f3cef65a43ea8ff29d0f998dd115e8fb870b1d9c323b989ac2d6d95fbbdf30d2b8e0ee69aefa9c0881bd62a2858c9904588fd44d58eb9f2d498dd84b8a5b18ea7b54deac8fc7874248f691973133aa-Xmx, which is its default written outpowersavegovernor, editor, browser, and agent sessions held on other cores. The figures are relative onlyd85fe4a30b9a909287ff7c864db6e7cbeb7047f53082f4fefda5d0b45195df28Validity, checked before any verdict. A unit 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, or the throttle counters cannot be read. A run counts only when all 101 answers are right (for d4 the stored vector asked for is the first hit in at least 95% of them), the record counts are right, and the query plan uses the index. A run that fails is left out and listed; a unit stops after a failed run in its first round, or after 3 failed runs in a row. A figure is INVALID when the A/A control has fewer than 10 clean pairs, when a difference is claimed while the A/A interval neither contains 1.00 nor lies inside [0.97, 1.03] and the interval of B against A does not lie wholly outside [0.90, 1.10], or when another timed job overlapped. A figure is WEAK with fewer than 10 clean pairs, 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 arms' 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 one (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 unit runs the three arms, each as 3 processes back to back, the order of the arms rotated and reversed from round to round. Rounds 0 to 12 (round 0 is dropped), then 2 more for a unit that has a weak figure, at most up to round 24. The heap runs follow d4 in rounds 0 to 2. 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 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. All units run 2 rounds at one fiftieth of the sizes first, heap runs included. It checks the setup and is never read as a result. A unit 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 units, sizes, thresholds, or pins after a timed run is a new study with a new comment first.
Limits.
(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.)tae898 commentedon Dec 5, 2026
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.
tae898 commentedon Dec 6, 2026
Status since the rules above. The kit changed twice after the first rehearsal. First the rehearsal was run again because its checksum changed, and it stopped on 2026-12-05 at 22:46 UTC. Then the timed lock became per core pair instead of one lock for the laptop (the reason is in my comment on #353). The checksum file of the scripts is now sha256
621d3c50e3bd51356584b67c98b141950ab8af79311c636a8bb655747911c3d6(the rules above gived85fe4a3...).smoke2and thenmain-n1wait in the queue on compare1, and nothing has been timed for this study yet.tae898 commentedon Dec 6, 2026
A limit of this study that I found while checking its wheel pins. The
26.12.1.dev2wheels were uploaded to PyPI on 2026-11-07 from bindings commit4b8a5b1, andmainis 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 ofto_json_liston 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.tae898 commentedon Dec 6, 2026
What this means for this study (follow-up to my limit comment above): Judging by their titles these three change other paths than reopening a database and the first query, so I do not expect them to move this study; the other 222 commits I have not checked against it.
State: queued on compare1 (
smoke2next, thenmain-n1), nothing timed yet. Next: once the final 26.12.1 wheels are on PyPI (there is only26.12.1.dev2so far), I will re-pin the same kit with its ownfill.py pypi 26.12.1and rerun what matters. Thedev2figures 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.)