Skip to content

Reduce Base64 SIMD overhead with generic interleaved SIMD primitives#4755

Merged
shai-almog merged 17 commits intosimd-revisitefrom
copilot/optimize-simd-base64-performance
Apr 17, 2026
Merged

Reduce Base64 SIMD overhead with generic interleaved SIMD primitives#4755
shai-almog merged 17 commits intosimd-revisitefrom
copilot/optimize-simd-base64-performance

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 15, 2026

  • Confirm why Base64 SIMD regressed while keeping Simd generic
  • Add native iOS overrides for the new generic offset-based byte helpers used by Base64
  • Add JavaSE validation wrappers for the same generic helpers so simulator coverage stays aligned
  • Extend unit tests for the generic offset-based helpers that are exercised by the Base64 SIMD path
  • [in progress] Re-run targeted unit tests and final validation

Copilot AI and others added 2 commits April 15, 2026 15:26
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/bbcd3a3b-1fcc-4818-a045-011025111878

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/bbcd3a3b-1fcc-4818-a045-011025111878

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
@shai-almog
Copy link
Copy Markdown
Collaborator

shai-almog commented Apr 15, 2026

Compared 37 screenshots: 37 matched.

Native Android coverage

  • 📊 Line coverage: 7.83% (4131/52779 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 6.15% (20442/332454), branch 2.98% (957/32086), complexity 3.65% (1121/30694), method 6.41% (917/14316), class 10.63% (202/1900)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

✅ Native Android screenshot tests passed.

Native Android coverage

  • 📊 Line coverage: 7.83% (4131/52779 lines covered) [HTML preview] (artifact android-coverage-report, jacocoAndroidReport/html/index.html)
    • Other counters: instruction 6.15% (20442/332454), branch 2.98% (957/32086), complexity 3.65% (1121/30694), method 6.41% (917/14316), class 10.63% (202/1900)
    • Lowest covered classes
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysKt – 0.00% (0/6327 lines covered)
      • kotlin.collections.unsigned.kotlin.collections.unsigned.UArraysKt___UArraysKt – 0.00% (0/2384 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.ClassReader – 0.00% (0/1519 lines covered)
      • kotlin.collections.kotlin.collections.CollectionsKt___CollectionsKt – 0.00% (0/1148 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.MethodWriter – 0.00% (0/923 lines covered)
      • kotlin.sequences.kotlin.sequences.SequencesKt___SequencesKt – 0.00% (0/730 lines covered)
      • kotlin.text.kotlin.text.StringsKt___StringsKt – 0.00% (0/623 lines covered)
      • org.jacoco.agent.rt.internal_b6258fc.asm.org.jacoco.agent.rt.internal_b6258fc.asm.Frame – 0.00% (0/564 lines covered)
      • kotlin.collections.kotlin.collections.ArraysKt___ArraysJvmKt – 0.00% (0/495 lines covered)
      • kotlinx.coroutines.kotlinx.coroutines.JobSupport – 0.00% (0/423 lines covered)

Benchmark Results

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 1285.000 ms
Base64 CN1 encode 87.000 ms
Base64 encode ratio (CN1/native) 0.068x (93.2% faster)
Base64 native decode 986.000 ms
Base64 CN1 decode 249.000 ms
Base64 decode ratio (CN1/native) 0.253x (74.7% faster)

@shai-almog
Copy link
Copy Markdown
Collaborator

shai-almog commented Apr 15, 2026

Compared 37 screenshots: 37 matched.
✅ Native iOS screenshot tests passed.

Benchmark Results

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

Build and Run Timing

Metric Duration
Simulator Boot 0 ms
Simulator Boot (Run) 1000 ms
App Install 2000 ms
App Launch 5000 ms
Test Execution 153000 ms

Detailed Performance Metrics

Metric Duration
Base64 payload size 8192 bytes
Base64 benchmark iterations 6000
Base64 native encode 917.000 ms
Base64 CN1 encode 1419.000 ms
Base64 encode ratio (CN1/native) 1.547x (54.7% slower)
Base64 native decode 806.000 ms
Base64 CN1 decode 973.000 ms
Base64 decode ratio (CN1/native) 1.207x (20.7% slower)
Base64 SIMD encode 723.000 ms
Base64 encode ratio (SIMD/native) 0.788x (21.2% faster)
Base64 encode ratio (SIMD/CN1) 0.510x (49.0% faster)
Base64 SIMD decode 498.000 ms
Base64 decode ratio (SIMD/native) 0.618x (38.2% faster)
Base64 decode ratio (SIMD/CN1) 0.512x (48.8% faster)

Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/c4483141-f308-4c53-9d5b-f8185272067f

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/44fd1aa3-15ab-484f-908f-71ae605a2c5f

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/43c5792a-216e-4635-bec3-dce6ce1c16da

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Copilot AI and others added 2 commits April 16, 2026 03:20
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/59bc0cc2-933a-457d-b5f2-7387ab1210f4

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/59bc0cc2-933a-457d-b5f2-7387ab1210f4

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/590ef420-e08c-4863-bc1d-374266ed3221

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/0af385dc-375d-435d-b488-72b71b1d5135

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Copilot AI and others added 2 commits April 16, 2026 13:26
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/f779927e-d85c-407e-862f-61c4d64ddd86

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/f779927e-d85c-407e-862f-61c4d64ddd86

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Copilot AI and others added 2 commits April 16, 2026 15:08
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/8587852f-737f-4503-9e44-7dd39ed13c3b

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/8587852f-737f-4503-9e44-7dd39ed13c3b

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Copilot AI and others added 2 commits April 16, 2026 17:22
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/806ca223-d5e2-458d-88a8-6e4347070c37

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/806ca223-d5e2-458d-88a8-6e4347070c37

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/baa9db39-0b7b-4734-ac26-5bf3d2bc986f

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
Agent-Logs-Url: https://github.com/codenameone/CodenameOne/sessions/50ddb198-a41b-4ec4-9be2-201d4a6f9527

Co-authored-by: shai-almog <67850168+shai-almog@users.noreply.github.com>
@shai-almog shai-almog marked this pull request as ready for review April 17, 2026 04:29
@shai-almog shai-almog merged commit a6c56cd into simd-revisite Apr 17, 2026
8 of 9 checks passed
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.

2 participants