Skip to content

JVM wheel: cold first reads and idle memory: measure warm-up properly, then add a CDS archive #313

Open

Description

@tae898

The first version of this issue claimed that the arcadedb-jvm wheel is 3 to 6 times slower than the native wheel on small results and uses 24 percent more peak memory. After reading the study's code and raw files I withdraw both claims as stated. This is the corrected issue.

What I got wrong. The 1k-row figures come from one fresh process per run in which the 1k cell is the first timed work, so they include the JVM's warm-up (JIT and class loading), not steady state: in the run order the JVM column falls from 3.60 ms at the first path to 1.99 ms at the last, and at the same 1k size it is already faster than native on the wide and the vec768 tables. The peak_rss_mib figure is not the peak of the phase: the study resets the high-water mark before every cell and reads it after the last one, so it is the last cell's figure (a 1M to_polars), and the 1.24 ratio says nothing about the whole run. Both are flaws in the study design, which I did not audit before quoting its output.

What still stands, read from the code and the files: the JVM wheel's idle memory before any timed work is a constant 54 to 66 MiB higher than the native wheel's, in all four table widths. The bundled JRE has no class-data-sharing archive (no .jsa in the wheel, no CDS step in the jlink stage of Dockerfile.build, -Xshare never set), and the JDK's AOT cache exists in the wheel's code (aot.py) but is not on by default. Both shorten JVM start and warm-up for short scripts.

Plan: measure warm-up properly (a warmed process, the same SQL text for every call, four cores, per-phase memory from the cgroup, not the process high-water mark), then try a default CDS archive built with the same -XX:+UseCompactObjectHeaders that jvm.py sets, and the AOT cache as a documented opt-in. Done when the cold first-read cost and the idle RSS are measured before and after with the same method and the changes that help are in a release.

Edited 2026-11-09: the title and the body replace the first version.

Activity

  1. added
    jvmThe arcadedb-jvm package (JPype build)
    nativeThe arcadedb package (native library build)
    performanceSpeed or memory of the bindings, with a measurement
    pythonPull requests that update python code
    on Nov 9, 2026
  2. added this to the 26.12.1 milestone on Nov 9, 2026
  3. changed the title [-]JVM wheel: small results are 3 to 6 times slower than native and peak RSS is 24 percent higher: profile and fix[/-] [+]JVM wheel: cold first reads and idle memory: measure warm-up properly, then add a CDS archive[/+] on Nov 9, 2026
  4. self-assigned this
    on Nov 9, 2026
  5. modified the milestones: 26.12.1, 27.1.1 on Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

jvmThe arcadedb-jvm package (JPype build)nativeThe arcadedb package (native library build)performanceSpeed or memory of the bindings, with a measurementpythonPull requests that update python code

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions