Skip to content

Optimize Array and Data encoding for XPC#8

Open
r-fogash wants to merge 2 commits intomainfrom
feature/optimized_data_and_array_transfer
Open

Optimize Array and Data encoding for XPC#8
r-fogash wants to merge 2 commits intomainfrom
feature/optimized_data_and_array_transfer

Conversation

@r-fogash
Copy link

@r-fogash r-fogash commented Feb 27, 2026

The problem:
Data swift type treats itself as an array of Int8. This leads to an issues with the current XPCEncoder / XPCDecoder:

  • each byte from Data encoded / decoded individually, this takes a lot of time
  • each Int8 is encoded into a larger data type which leads to larger size of the encoded data
    Same issues applies for Arrays.

One possible solution is to encode Data and Array types into xpc data (because Data and Array is a continuous memory, so we can try)

Implementation
XPCRawEncodable and XPCRawDecodable protocols were introduced.
Data and Array extends that protocol in order to implement the serealization into / from xpc data object

XPC encoders are updated

also, package version update to macOS 11

@r-fogash r-fogash self-assigned this Feb 27, 2026
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