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
    jvm
    native
    performance
    python
    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
  6. tae898 commented on Nov 22, 2026

    @tae898
    CollaboratorAuthor

    A note for the record, because this issue had no comment yet: the CDS archive half shipped. #332 was merged on 2026-11-10 and is in 26.11.1.post1 and every release after it. Its title says "closes #313", but its base was release/26.11.1 and not the default branch, so GitHub did not close this issue. The change is on main as well (scripts/dump_cds_archive.sh, tests/test_jvm_cds.py, and the "Class-data sharing" section of installation.adoc). The AOT cache stays an opt-in and is documented on the same page.

    I keep the issue open because the other half is not done. #332 made no speed claim and did not measure memory. What is left is the measurement this issue asks for: the cold first read and the idle RSS, before and after, with the same method. It now runs on the 26.12.1 wheels (see #315).

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

Metadata

Metadata

Assignees

Labels

jvmnativeperformancepython

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions