swiftlang / swiftlang/swift-java

Optimize: See if we can optimize Java byte array -> [UInt8] mapping some more

Open
#478 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature:jextract mode:ffm performance
Dominant language
Swift
Stars
1.2k
Forks
123
Avg merge
1d 7h
Merged PRs (30d)
16

Description

Today the impl is just a quick naive: allocate native segment, then the array in Swift has to copy the bytes again.

Using [UInt8] at boundaries leads to un-necessary copying; prefer using Data or DataProtocol today.
It would be interesting to get this down to one single call, but we need to get the heap array from java written into native anyway.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files, tests, or entry points are named. Start by tracing the current Java byte-array to Swift [UInt8] boundary and compare the existing native-segment and array allocations. Done means reducing unnecessary copying while preserving the interop behavior, with the acceptable boundary representation and performance target clarified first.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, swift
Domain
performance, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.