Skip to content

Backend: distributed cache and messaging (Redis, RabbitMQ, Kafka, SQS, Pub/Sub) - #6209

Open
shai-almog wants to merge 14 commits into
masterfrom
backend-messaging-cache
Open

shai-almog wants to merge 14 commits into
masterfrom
backend-messaging-cache

Conversation

@shai-almog

Copy link
Copy Markdown
Collaborator

Adds a shared key/value store and messaging to the backend, so a server can scale out past one instance.

  • Key/value store: Redis, Valkey or KeyDB through cn1.kv.url, or Spring's spring.data.redis.*. It backs @Cacheable/@CachePut/@CacheEvict, sessions, rate limits and @Scheduled locks.
  • Messaging: MessageTemplate plus @MessageListener. @KafkaListener, @RabbitListener and @JmsListener are also accepted as written.
    • Delivery is at least once, with retry and backoff, then a .dlq dead-letter destination.
    • A send inside a transaction goes through a transactional outbox.
  • Transports: memory:, db: (the default with a database), Redis Streams, AMQP 0-9-1, Kafka, SQS and Pub/Sub.
    • Each is a native wire client: no client jars and no reflection.
    • Listeners and cache aspects are generated at build time, and only the configured transports are compiled in.
  • Docs and sample: a developer-guide chapter (Backend-Messaging.asciidoc), and Savor caches menu photos with @Cacheable.

Tested with the msgcheck harness against real brokers in podman: Kafka, RabbitMQ, Redis, ElasticMQ and the Pub/Sub emulator, on both the JVM and ParparVM.

🤖 Generated with Claude Code

shai-almog and others added 8 commits November 10, 2026 17:09
…ons, rate limits and scheduler locks

A Redis-protocol client (RESP2, no client jar) behind a KeyValueStore
interface, with an in-process store as the default. cn1.kv.url or Spring's
spring.data.redis.* selects Redis/Valkey/KeyDB; the store is a server
resource opened on first use and closed at shutdown.

On top of it: @Cacheable/@CachePut/@CacheEvict woven at build time with a
compiled key expression and generated JSON codecs, cn1.session.store=kv,
KeyValueRateLimiter, scheduler locks without a database, an injectable
KeyValueStore and a health entry.

Tested with demo/kvcheck on the JVM and ParparVM against podman Redis 7,
Valkey 8 and an ACL-protected Redis, and BackendBeansTest with
CN1_TEST_REDIS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ox, retry and dead letters

MessageTemplate and @MessageListener (with the Spring-named @KafkaListener,
@RabbitListener and @JmsListener aliases) over a pluggable MessageTransport.
The build discovers listeners, generates each subscription with its typed
decode, and registers only the transports application.properties names.
Without a broker URL a server with a database uses the db: transport (a
queue table claimed with SKIP LOCKED on PostgreSQL), otherwise memory:.
A send inside a transaction goes through an outbox relayed after commit.
Failed deliveries retry with backoff and then land in <destination>.dlq.
First cut of the Redis Streams transport, tested in the next change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
redis:// sends with XADD and consumes through XREADGROUP consumer groups,
reclaiming abandoned messages with XPENDING/XCLAIM after the lease and
holding retries in a sorted set. amqp:// is a client for RabbitMQ written on
Tcp: durable queues, persistent publishes with publisher confirms, one
consuming connection per subscription with a prefetch equal to its
concurrency, retries parked in TTL queues that dead-letter back, and
reconnection after the broker restarts.

Fixes found on the way:
- the outbox did database work inside the commit callback, which the
  transaction manager refuses; the outbox thread now relays, sending before
  it deletes so a crash re-sends instead of losing the message, and a sweep
  claims a row before sending it
- a module of message listeners alone produced no server
- the consumer loop logged a broker outage once a second

Tested on the JVM and natively against Redis 7, Valkey and RabbitMQ 3.13 in
podman, and through the generated wiring for every transport.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Kafka client written on the backend's own Tcp layer: produce with acks=all and
Kafka's murmur2 partitioner, consumer groups with range assignment computed from
every member's subscription, per-partition ordering, offsets committed after
the handler returns, non-blocking retry topics and a dead-letter topic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both over HTTP with no vendor SDK: SQS through the backend's SigV4 signer, with
retries as visibility changes counted by SQS's receive count; Pub/Sub through a
service-account key or the metadata server (or the emulator), one subscription
per group, retries as ack-deadline changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Kafka: advance the fetch offset past control and empty batches so a
  partition never stalls on one.
- Cache keys: refuse identity-keyed parameters (arrays, objects without
  their own toString) at build time; a null key part no longer collides
  with the text "null".
- Transports: a RuntimeException in a poll, ack or outbox relay no longer
  kills the consumer thread.
- cn1.messaging.transports names the transports to compile in when the
  broker URL is only known at run time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Developer Guide build artifacts are available for download from this workflow run:

Developer Guide quality checks:

  • AsciiDoc linter: No issues found (report)
  • Vale: No alerts found (report)
  • Paragraph capitalization: No paragraph capitalization issues (report)
  • LanguageTool: No grammar matches (report)
  • Image references: No unused images detected (report)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare Preview

@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ Continuous Quality Report

Test & Coverage

Static Analysis

  • SpotBugs [Report archive]
    • ✅ ByteCodeTranslator: 0 findings (no issues)
    • ✅ android: 0 findings (no issues)
    • ✅ android-compat: 0 findings (no issues)
    • ✅ android-res-compiler: 0 findings (no issues)
    • ✅ backend: 0 findings (no issues)
    • ✅ backend-test: 0 findings (no issues)
    • ✅ build-engine: 0 findings (no issues)
    • ✅ build-hint-catalog: 0 findings (no issues)
    • ✅ build-hint-tools: 0 findings (no issues)
    • ✅ codenameone-gradle-plugin: 0 findings (no issues)
    • ✅ codenameone-maven-plugin: 0 findings (no issues)
    • ✅ compose-compat: 0 findings (no issues)
    • ✅ core-unittests: 0 findings (no issues)
    • ✅ desktop-compat-runtime: 0 findings (no issues)
    • ✅ fxml-compiler: 0 findings (no issues)
    • ✅ ios: 0 findings (no issues)
    • ✅ javac: 0 findings (no issues)
    • ✅ javafx-compat: 0 findings (no issues)
    • ✅ project-model: 0 findings (no issues)
    • ✅ python-runtime: 0 findings (no issues)
    • ✅ python-transpiler: 0 findings (no issues)
    • ✅ swing-compat: 0 findings (no issues)
  • ✅ PMD: 0 findings (no issues) [Report archive]
  • ✅ Checkstyle: 0 findings (no issues) [Report archive]

Generated automatically by the PR CI workflow.

…ache

# Conflicts:
#	docs/developer-guide/languagetool-accept.txt
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

✅ ByteCodeTranslator Quality Report

Test & Coverage

  • ✅ Tests: 933 total, 0 failed, 55 skipped

Benchmark Results

  • Execution Time: 9690 ms

  • Hotspots (Top 20 sampled methods):

    • 10.08% java.lang.System.identityHashCode (137 samples)
    • 7.95% java.util.ArrayList.indexOf (108 samples)
    • 7.14% java.lang.Object.hashCode (97 samples)
    • 3.83% com.codename1.tools.translator.BytecodeMethod.equals (52 samples)
    • 2.65% java.lang.StringBuilder.append (36 samples)
    • 1.91% java.util.HashMap.hash (26 samples)
    • 1.77% com.codename1.tools.translator.ByteCodeClass.hasDeclaredMethod (24 samples)
    • 1.69% com.codename1.tools.translator.ByteCodeClass.fillVirtualMethodTable (23 samples)
    • 1.62% com.codename1.tools.translator.classfile.analysis.Frame.merge (22 samples)
    • 1.55% com.codename1.tools.translator.bytecodes.Invoke.resolveDirectTarget (21 samples)
    • 1.32% com.codename1.tools.translator.JavascriptReachability.enqueueResolved (18 samples)
    • 1.25% com.codename1.tools.translator.NativeSymbolIndex.<init> (17 samples)
    • 1.25% java.io.FileOutputStream.writeBytes (17 samples)
    • 1.18% java.lang.String.equals (16 samples)
    • 1.18% com.codename1.tools.translator.BytecodeMethod.updateInlinableFieldDependencies (16 samples)
    • 1.10% java.util.HashMap.putVal (15 samples)
    • 1.10% com.codename1.tools.translator.BytecodeMethod.addToConstantPool (15 samples)
    • 1.03% java.lang.StringCoding.encode (14 samples)
    • 0.96% com.codename1.tools.translator.Parser.cullMethods (13 samples)
    • 0.96% java.util.AbstractCollection.containsAll (13 samples)
  • ⚠️ Coverage report not generated.

Static Analysis

  • ✅ SpotBugs: no findings (report was not generated by the build).
  • ⚠️ PMD report not generated.
  • ⚠️ Checkstyle report not generated.

Generated automatically by the PR CI workflow.

@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 195 screenshots: 195 matched.

Native Android coverage

  • 📊 Line coverage: 19.17% (56159/292885 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 18.13% (270520/1492353), branch 12.38% (19672/158943), complexity 10.36% (15845/153017), method 15.73% (11410/72518), class 27.93% (2247/8045)
    • Lowest covered classes
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2396 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • androidx.compose.runtime.androidx.compose.runtime.LinkComposer – 0.00% (0/1430 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlinx.coroutines.channels.kotlinx.coroutines.channels.BufferedChannel – 0.00% (0/863 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/744 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/630 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 19.17% (56159/292885 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 18.13% (270520/1492353), branch 12.38% (19672/158943), complexity 10.36% (15845/153017), method 15.73% (11410/72518), class 27.93% (2247/8045)
    • Lowest covered classes
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2396 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.ClassReader – 0.00% (0/1524 lines covered)
      • androidx.compose.runtime.androidx.compose.runtime.LinkComposer – 0.00% (0/1430 lines covered)
      • org.jacoco.agent.rt.internal_0e20598.asm.org.jacoco.agent.rt.internal_0e20598.asm.MethodWriter – 0.00% (0/922 lines covered)
      • kotlinx.coroutines.channels.kotlinx.coroutines.channels.BufferedChannel – 0.00% (0/863 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/744 lines covered)
      • com.google.common.cache.com.google.common.cache.LocalCache$Segment – 0.00% (0/726 lines covered)
      • okio.okio.Buffer – 0.00% (0/687 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/630 lines covered)
      • com.codename1.androidcompat.rt.com.codename1.androidcompat.rt.TextXmlPullParser – 0.00% (0/623 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend scalar fallback (no native SIMD)
SIMD int-add (64K x300) java 143ms / native 42ms = 3.4x speedup
SIMD float-mul (64K x300) java 48ms / native 70ms = 0.6x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 45.000 ms
Base64 CN1 decode 48.000 ms
Base64 native encode 295.000 ms
Base64 encode ratio (CN1/native) 0.153x (84.7% faster)
Base64 native decode 143.000 ms
Base64 decode ratio (CN1/native) 0.336x (66.4% faster)
Image encode benchmark status skipped (SIMD unsupported)

@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 231 screenshots: 231 matched.
✅ JavaScript-port screenshot tests passed.

@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 210 screenshots: 210 matched.
Native Windows port (x64 / Intel-AMD): full hellocodenameone screenshot suite rendered offscreen with Direct2D/DirectWrite, plus the real benchmarks (base64 native/CN1/SIMD, image createMask/applyMask/modifyAlpha/PNG/JPEG, SSE2 SIMD kernels). Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 56ms / native 5ms = 11.2x speedup
SIMD float-mul (64K x300) java 56ms / native 4ms = 14.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 77.000 ms
Base64 CN1 decode 117.000 ms
Base64 SIMD encode 109.000 ms
Base64 encode ratio (SIMD/CN1) 1.416x (41.6% slower)
Base64 SIMD decode 105.000 ms
Base64 decode ratio (SIMD/CN1) 0.897x (10.3% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 9.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.333x (66.7% faster)
Image applyMask (SIMD off) 39.000 ms
Image applyMask (SIMD on) 27.000 ms
Image applyMask ratio (SIMD on/off) 0.692x (30.8% faster)
Image modifyAlpha (SIMD off) 29.000 ms
Image modifyAlpha (SIMD on) 15.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.517x (48.3% faster)
Image modifyAlpha removeColor (SIMD off) 32.000 ms
Image modifyAlpha removeColor (SIMD on) 21.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.656x (34.4% faster)

ParparVM vs HotSpot (JDK 25): Windows x64

Runner CPU: AMD64 Family 25 Model 1 Stepping 1, AuthenticAMD (baseline windows-x64@amd64-family-25-model-1-authenticamd)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in vm/selfhost/perf-baseline/ is a regression and fails; one that far below is an improvement, reported but not failed (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (WinHelloMain) 4 1.68x (base 1.22x, +37.7%) 0.73x (base 0.58x, +24.9%) ok
translator (self) 4 0.73x (base 0.83x, -12.5%) 0.58x (base 0.54x, +7.0%) ok
intArithmetic 4 1.10x (base 1.10x, +0.0%) 0.06x (base 0.06x, +3.1%) ok
longArithmetic 4 1.14x (base 1.08x, +5.1%) 0.06x (base 0.05x, +3.7%) ok
mathTranscendental 4 0.78x (base 0.79x, -0.7%) 0.06x (base 0.06x, +3.3%) ok
arraySequential 4 1.39x (base 1.36x, +1.7%) 0.39x (base 0.39x, +0.3%) ok
arrayRandom 4 0.99x (base 1.06x, -6.7%) 0.23x (base 0.23x, +0.6%) ok
objectAllocation 4 1.57x (base 1.56x, +0.8%) 0.31x (base 0.39x, -18.5%) ok
valueEscape 4 0.10x (base 0.10x, +0.4%) 0.05x (base 0.04x, +2.9%) ok
hashMapChurn 4 1.80x (base 1.80x, +0.1%) 0.11x (base 0.09x, +19.8%) ok
stringBuilding 4 1.25x (base 1.22x, +3.2%) 0.32x (base 0.32x, +0.1%) ok
recursion 4 1.41x (base 1.49x, -5.8%) 0.06x (base 0.06x, +1.9%) ok
quicksort 4 1.12x (base 1.13x, -1.5%) 0.12x (base 0.12x, +1.1%) ok

Result: no regression

shai-almog and others added 2 commits November 11, 2026 03:43
The compiled-tests build refused key "#id" on Catalog.photo. The guide's
example and wording now lead with #p0 and say when a name works. Initializr
template resynced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ache

# Conflicts:
#	scripts/initializr/common/src/main/resources/savor-modules.zip
@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 210 screenshots: 210 matched.
Native Windows port, REAL shipping pipeline: the hellocodenameone screenshot suite rendered by a binary CROSS-COMPILED on Linux (clang-cl + xwin, WebView2 linked) and RUN on a Windows x64 runner. Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 26ms / native 2ms = 13.0x speedup
SIMD float-mul (64K x300) java 25ms / native 2ms = 12.5x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 41.000 ms
Base64 CN1 decode 47.000 ms
Base64 SIMD encode 51.000 ms
Base64 encode ratio (SIMD/CN1) 1.244x (24.4% slower)
Base64 SIMD decode 46.000 ms
Base64 decode ratio (SIMD/CN1) 0.979x (2.1% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 7.000 ms
Image createMask (SIMD on) 2.000 ms
Image createMask ratio (SIMD on/off) 0.286x (71.4% faster)
Image applyMask (SIMD off) 17.000 ms
Image applyMask (SIMD on) 10.000 ms
Image applyMask ratio (SIMD on/off) 0.588x (41.2% faster)
Image modifyAlpha (SIMD off) 14.000 ms
Image modifyAlpha (SIMD on) 8.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.571x (42.9% faster)
Image modifyAlpha removeColor (SIMD off) 21.000 ms
Image modifyAlpha removeColor (SIMD on) 7.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.333x (66.7% faster)

shai-almog and others added 2 commits November 11, 2026 07:46
The Initializr template builds against the released framework, which has no
backend cache annotations yet, so the shipped Savor failed to compile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ache

# Conflicts:
#	docs/developer-guide/languagetool-accept.txt
@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 192 screenshots: 192 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 763 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 55ms / native 3ms = 18.3x speedup
SIMD float-mul (64K x300) java 57ms / native 3ms = 19.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 49.000 ms
Base64 CN1 decode 58.000 ms
Base64 native encode 669.000 ms
Base64 encode ratio (CN1/native) 0.073x (92.7% faster)
Base64 native decode 288.000 ms
Base64 decode ratio (CN1/native) 0.201x (79.9% faster)
Base64 SIMD encode 55.000 ms
Base64 encode ratio (SIMD/CN1) 1.122x (12.2% slower)
Base64 SIMD decode 49.000 ms
Base64 decode ratio (SIMD/CN1) 0.845x (15.5% faster)
Base64 encode ratio (SIMD/native) 0.082x (91.8% faster)
Base64 decode ratio (SIMD/native) 0.170x (83.0% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 14.000 ms
Image createMask (SIMD on) 5.000 ms
Image createMask ratio (SIMD on/off) 0.357x (64.3% faster)
Image applyMask (SIMD off) 73.000 ms
Image applyMask (SIMD on) 51.000 ms
Image applyMask ratio (SIMD on/off) 0.699x (30.1% faster)
Image modifyAlpha (SIMD off) 62.000 ms
Image modifyAlpha (SIMD on) 68.000 ms
Image modifyAlpha ratio (SIMD on/off) 1.097x (9.7% slower)
Image modifyAlpha removeColor (SIMD off) 81.000 ms
Image modifyAlpha removeColor (SIMD on) 63.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.778x (22.2% faster)

@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 210 screenshots: 210 matched.
Native Linux port (x64), GTK3/Cairo/Pango, ParparVM bytecode-to-C (no JVM): the hellocodenameone screenshot suite rendered by a native ELF built + run on the GitHub x64 runner. Baseline: scripts/linux/screenshots.

ParparVM vs HotSpot (JDK 25): Linux x64

Runner CPU: AMD EPYC 9V45 96-Core Processor (baseline linux-x64@amd-epyc-9v45-96-core-processor)

1 performance regression:

  • recursion on all 4 CPUs: time 4.61x against a 1.34x baseline (+244.1%, tolerance 20%)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in vm/selfhost/perf-baseline/ is a regression and fails; one that far below is an improvement, reported but not failed (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (LinuxHelloMain) 4 1.18x (base 0.92x, +28.7%) 0.83x (base 0.84x, -1.4%) ok
translator (self) 4 0.65x (base 0.64x, +1.2%) 0.57x (base 0.55x, +3.9%) ok
intArithmetic 4 1.00x (base 1.00x, +0.5%) 0.04x (base 0.06x, -31.9%) ok
longArithmetic 4 1.00x (base 0.99x, +0.1%) 0.04x (base 0.07x, -48.1%) ok
mathTranscendental 4 1.20x (base 1.20x, -0.3%) 0.04x (base 0.06x, -27.5%) ok
arraySequential 4 2.79x (base 2.91x, -3.9%) 0.36x (base 0.36x, +0.7%) ok
arrayRandom 4 1.00x (base 1.04x, -3.9%) 0.20x (base 0.23x, -10.9%) ok
objectAllocation 4 1.56x (base 1.61x, -3.0%) 0.24x (base 0.24x, +2.5%) ok
valueEscape 4 0.10x (base 0.12x, -15.0%) 0.03x (base 0.04x, -31.4%) ok
hashMapChurn 4 1.25x (base 1.31x, -4.3%) 0.09x (base 0.09x, +5.0%) ok
stringBuilding 4 1.52x (base 1.58x, -3.4%) 0.26x (base 0.22x, +20.4%) ok
recursion 4 4.61x (base 1.34x, +244.1%) 0.04x (base 0.08x, -46.8%) REGRESSION (time +244.1%)
quicksort 4 1.09x (base 1.06x, +2.8%) 0.10x (base 0.11x, -11.2%) ok

A change that moves performance ON PURPOSE records the new baseline in vm/selfhost/perf-baseline/pr/6209.json, with the reason, from this job's perf-results.json. The rebaseline is then part of this pull request's diff:

python3 vm/selfhost/calibrate-perf-baseline.py --pr 6209 --reason "<why these benchmarks moved>" perf-results.json

Result: performance regression

@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 210 screenshots: 210 matched.
Native Linux port (arm64), GTK3/Cairo/Pango, ParparVM bytecode-to-C (no JVM): the hellocodenameone screenshot suite rendered by a native ELF built + run on the GitHub arm64 runner. Baseline: scripts/linux/screenshots-arm.

ParparVM vs HotSpot (JDK 25): Linux arm64

Runner CPU: Neoverse-N2 (baseline linux-arm64@neoverse-n2)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in vm/selfhost/perf-baseline/ is a regression and fails; one that far below is an improvement, reported but not failed (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (LinuxHelloMain) 4 1.13x (base 1.02x, +10.6%) 0.80x (base 0.66x, +20.6%) ok
translator (self) 4 0.77x (base 0.70x, +10.8%) 0.46x (base 0.43x, +7.6%) ok
intArithmetic 4 1.05x (base 1.04x, +0.0%) 0.03x (base 0.03x, +4.7%) ok
longArithmetic 4 0.79x (base 0.79x, -0.3%) 0.03x (base 0.03x, +5.1%) ok
mathTranscendental 4 1.09x (base 1.10x, -0.3%) 0.04x (base 0.03x, +9.5%) ok
arraySequential 4 0.36x (base 0.36x, -0.5%) 0.37x (base 0.37x, +0.2%) ok
arrayRandom 4 0.94x (base 0.94x, -0.1%) 0.20x (base 0.20x, +0.7%) ok
objectAllocation 4 1.99x (base 1.77x, +12.3%) 0.36x (base 0.37x, -2.7%) ok
valueEscape 4 0.51x (base 0.51x, -0.1%) 0.03x (base 0.03x, +6.0%) ok
hashMapChurn 4 0.86x (base 0.84x, +2.2%) 0.11x (base 0.12x, -5.1%) ok
stringBuilding 4 1.39x (base 1.57x, -11.3%) 0.27x (base 0.26x, +1.7%) ok
recursion 4 1.54x (base 1.43x, +7.6%) 0.04x (base 0.04x, +3.2%) ok
quicksort 4 1.00x (base 0.99x, +0.4%) 0.10x (base 0.09x, +2.8%) ok

Result: no regression

@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 210 screenshots: 210 matched.
Native Windows port (arm64 / Apple Silicon - Arm): full hellocodenameone screenshot suite rendered offscreen with Direct2D/DirectWrite, plus the real benchmarks (base64 native/CN1/SIMD, image createMask/applyMask/modifyAlpha/PNG/JPEG, NEON SIMD kernels). Compared against the in-repo baseline in scripts/windows/screenshots.

Benchmark Results

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 50ms / native 2ms = 25.0x speedup
SIMD float-mul (64K x300) java 49ms / native 3ms = 16.3x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path gated to scalar (CPU autovectorizes scalar; explicit SIMD not beneficial here)
Base64 CN1 encode 61.000 ms
Base64 CN1 decode 68.000 ms
Base64 SIMD encode 75.000 ms
Base64 encode ratio (SIMD/CN1) 1.230x (23.0% slower)
Base64 SIMD decode 68.000 ms
Base64 decode ratio (SIMD/CN1) 1.000x (0.0% slower)
Image encode benchmark iterations 100
Image createMask (SIMD off) 5.000 ms
Image createMask (SIMD on) 1.000 ms
Image createMask ratio (SIMD on/off) 0.200x (80.0% faster)
Image applyMask (SIMD off) 15.000 ms
Image applyMask (SIMD on) 16.000 ms
Image applyMask ratio (SIMD on/off) 1.067x (6.7% slower)
Image modifyAlpha (SIMD off) 18.000 ms
Image modifyAlpha (SIMD on) 8.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.444x (55.6% faster)
Image modifyAlpha removeColor (SIMD off) 20.000 ms
Image modifyAlpha removeColor (SIMD on) 10.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.500x (50.0% faster)

ParparVM vs HotSpot (JDK 25): Windows arm64

Runner CPU: ARMv8 (64-bit) Family 8 Model D49 Revision 0, MICROSOFT CORPORATION (baseline windows-arm64@armv8-64-bit-family-8-model-d49-microsoft-corporation)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in vm/selfhost/perf-baseline/ is a regression and fails; one that far below is an improvement, reported but not failed (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (WinHelloMain) 4 1.50x (base 1.45x, +3.6%) 0.76x (base 0.75x, +1.4%) ok
translator (self) 4 0.89x (base 0.84x, +6.4%) 0.50x (base 0.51x, -1.7%) ok
intArithmetic 4 1.04x (base 1.04x, -0.0%) 0.06x (base 0.06x, +3.3%) ok
longArithmetic 4 0.79x (base 0.80x, -0.0%) 0.06x (base 0.06x, +3.6%) ok
mathTranscendental 4 0.73x (base 0.72x, +1.8%) 0.07x (base 0.06x, +1.9%) ok
arraySequential 4 0.35x (base 0.46x, -22.4%) 0.39x (base 0.39x, +0.0%) ok
arrayRandom 4 0.94x (base 0.94x, +0.1%) 0.23x (base 0.23x, +0.3%) ok
objectAllocation 4 1.85x (base 1.82x, +1.7%) 0.33x (base 0.43x, -24.1%) ok
valueEscape 4 0.76x (base 0.76x, +0.1%) 0.05x (base 0.05x, +3.8%) ok
hashMapChurn 4 1.00x (base 0.98x, +1.0%) 0.12x (base 0.12x, +4.0%) ok
stringBuilding 4 1.53x (base 1.43x, +7.3%) 0.27x (base 0.27x, -0.3%) ok
recursion 4 1.42x (base 1.46x, -2.9%) 0.07x (base 0.07x, +1.4%) ok
quicksort 4 1.01x (base 1.00x, +0.5%) 0.12x (base 0.12x, +0.6%) ok

Result: no regression

@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 253 screenshots: 253 matched.
✅ Native Apple Watch (watchOS, Core Graphics) screenshot tests passed.

@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 196 screenshots: 196 matched.
✅ Native Mac screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 712 seconds

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 51ms / native 2ms = 25.5x speedup
SIMD float-mul (64K x300) java 51ms / native 3ms = 17.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 native bridge unavailable (CN1 + SIMD + image benchmarks only)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 55.000 ms
Base64 CN1 decode 61.000 ms
Image encode benchmark iterations 100
Image createMask (SIMD off) 7.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.429x (57.1% faster)
Image applyMask (SIMD off) 65.000 ms
Image applyMask (SIMD on) 67.000 ms
Image applyMask ratio (SIMD on/off) 1.031x (3.1% slower)
Image modifyAlpha (SIMD off) 66.000 ms
Image modifyAlpha (SIMD on) 54.000 ms
Image modifyAlpha ratio (SIMD on/off) 0.818x (18.2% faster)
Image modifyAlpha removeColor (SIMD off) 67.000 ms
Image modifyAlpha removeColor (SIMD on) 56.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.836x (16.4% faster)

ParparVM vs HotSpot (JDK 25): macOS arm64

Runner CPU: Apple M1 (Virtual) (baseline macos-arm64)

1 improvement past the baseline (not a failure; rebaseline to lock it in):

  • intArithmetic on all 3 CPUs: RAM 0.04x against a 0.12x baseline (-65.8%, tolerance 25%)

Ratios are ParparVM / JDK 25: below 1.00x ParparVM is faster (time) or smaller (RAM). Median of 5 interleaved, paired rounds; every run's output was verified. A ratio more than 20% (time) / 25% (RAM) above its baseline in vm/selfhost/perf-baseline/ is a regression and fails; one that far below is an improvement, reported but not failed (a row whose calibration runs were noisier carries a wider tolerance), and for RAM the change must also exceed 0.05x in absolute terms. Both run unpinned on all of the runner's CPUs, with their own default thread counts.

Benchmark Cores Time RAM Status
hello (HelloCodenameOne) 3 1.11x (base 0.96x, +16.3%) 0.89x (base 0.93x, -3.5%) ok
translator (self) 3 0.63x (base 0.62x, +1.7%) 0.72x (base 0.78x, -7.6%) ok
intArithmetic 3 1.06x (base 1.03x, +2.6%) 0.04x (base 0.12x, -65.8%) improved: rebaseline to lock in (RAM -65.8%)
longArithmetic 3 1.03x (base 1.03x, +0.2%) 0.12x (base 0.07x, +68.6%) ok
mathTranscendental 3 0.92x (base 1.01x, -8.8%) 0.12x (base 0.12x, +0.5%) ok
arraySequential 3 0.46x (base 0.42x, +9.9%) 0.53x (base 0.53x, +0.2%) ok
arrayRandom 3 1.01x (base 0.99x, +2.5%) 0.33x (base 0.32x, +0.5%) ok
objectAllocation 3 1.00x (base 1.11x, -9.9%) 0.70x (base 0.72x, -3.3%) ok
valueEscape 3 0.49x (base 0.51x, -3.3%) 0.09x (base 0.09x, -2.4%) ok
hashMapChurn 3 1.11x (base 1.18x, -5.4%) 0.07x (base 0.07x, +0.2%) ok
stringBuilding 3 0.98x (base 0.84x, +15.9%) 0.46x (base 0.46x, +0.1%) ok
recursion 3 1.22x (base 1.24x, -0.8%) 0.12x (base 0.12x, -0.4%) ok
quicksort 3 1.01x (base 1.01x, +0.2%) 0.11x (base 0.11x, +1.3%) ok

A change that moves performance ON PURPOSE records the new baseline in vm/selfhost/perf-baseline/pr/6209.json, with the reason, from this job's perf-results.json. The rebaseline is then part of this pull request's diff:

python3 vm/selfhost/calibrate-perf-baseline.py --pr 6209 --reason "<why these benchmarks moved>" perf-results.json

Result: no regression (improved past the baseline: consider rebaselining)

@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 193 screenshots: 193 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 3478 seconds

Build and Run Timing

Metric Duration
Simulator Boot 120000 ms
Simulator Boot (Run) 0 ms
App Install 15000 ms
App Launch 1000 ms
Test Execution 459000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 486ms / native 5ms = 97.2x speedup
SIMD float-mul (64K x300) java 308ms / native 4ms = 77.0x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 58.000 ms
Base64 CN1 decode 75.000 ms
Base64 native encode 1520.000 ms
Base64 encode ratio (CN1/native) 0.038x (96.2% faster)
Base64 native decode 1125.000 ms
Base64 decode ratio (CN1/native) 0.067x (93.3% faster)
Base64 SIMD encode 82.000 ms
Base64 encode ratio (SIMD/CN1) 1.414x (41.4% slower)
Base64 SIMD decode 72.000 ms
Base64 decode ratio (SIMD/CN1) 0.960x (4.0% faster)
Base64 encode ratio (SIMD/native) 0.054x (94.6% faster)
Base64 decode ratio (SIMD/native) 0.064x (93.6% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 7.000 ms
Image createMask (SIMD on) 3.000 ms
Image createMask ratio (SIMD on/off) 0.429x (57.1% faster)
Image applyMask (SIMD off) 287.000 ms
Image applyMask (SIMD on) 476.000 ms
Image applyMask ratio (SIMD on/off) 1.659x (65.9% slower)
Image modifyAlpha (SIMD off) 44.000 ms
Image modifyAlpha (SIMD on) 60.000 ms
Image modifyAlpha ratio (SIMD on/off) 1.364x (36.4% slower)
Image modifyAlpha removeColor (SIMD off) 699.000 ms
Image modifyAlpha removeColor (SIMD on) 28.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.040x (96.0% faster)

@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 188 screenshots: 188 matched.
✅ Native Apple TV (tvOS, Metal) screenshot tests passed.

@shai-almog

shai-almog commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator Author

Compared 193 screenshots: 193 matched.
✅ Native iOS Metal screenshot tests passed.

Benchmark Results

  • VM Translation Time: 0 seconds
  • Compilation Time: 3736 seconds

Build and Run Timing

Metric Duration
Simulator Boot 106000 ms
Simulator Boot (Run) 9000 ms
App Install 19000 ms
App Launch 11000 ms
Test Execution 608000 ms

Detailed Performance Metrics

Metric Duration
SIMD kernel backend SSE2 (x64) / NEON (arm64) native kernels
SIMD int-add (64K x300) java 255ms / native 4ms = 63.7x speedup
SIMD float-mul (64K x300) java 214ms / native 26ms = 8.2x speedup
SIMD kernel correctness PASS (native result == scalar reference)
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 SIMD byte path active (NEON-accelerated)
Base64 CN1 encode 75.000 ms
Base64 CN1 decode 72.000 ms
Base64 native encode 2126.000 ms
Base64 encode ratio (CN1/native) 0.035x (96.5% faster)
Base64 native decode 1202.000 ms
Base64 decode ratio (CN1/native) 0.060x (94.0% faster)
Base64 SIMD encode 223.000 ms
Base64 encode ratio (SIMD/CN1) 2.973x (197.3% slower)
Base64 SIMD decode 152.000 ms
Base64 decode ratio (SIMD/CN1) 2.111x (111.1% slower)
Base64 encode ratio (SIMD/native) 0.105x (89.5% faster)
Base64 decode ratio (SIMD/native) 0.126x (87.4% faster)
Image encode benchmark iterations 100
Image createMask (SIMD off) 9.000 ms
Image createMask (SIMD on) 5.000 ms
Image createMask ratio (SIMD on/off) 0.556x (44.4% faster)
Image applyMask (SIMD off) 81.000 ms
Image applyMask (SIMD on) 135.000 ms
Image applyMask ratio (SIMD on/off) 1.667x (66.7% slower)
Image modifyAlpha (SIMD off) 160.000 ms
Image modifyAlpha (SIMD on) 282.000 ms
Image modifyAlpha ratio (SIMD on/off) 1.763x (76.3% slower)
Image modifyAlpha removeColor (SIMD off) 73.000 ms
Image modifyAlpha removeColor (SIMD on) 48.000 ms
Image modifyAlpha removeColor ratio (SIMD on/off) 0.658x (34.2% faster)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant