swiftlang / swiftlang/swift-java
Optimize: See if we can optimize Java byte array -> [UInt8] mapping some more
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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