[PR #36] Add support for Span<byte> #63

Open
opened 2026-01-30 21:26:59 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/claunia/plist-cil/pull/36

State: closed
Merged: Yes


We're doing a performance review of our application and are trying to make sure of the new Span<byte> and ReadOnlySpan<byte> types which are new in .NET land.

For plist-cil, working with Span<byte> opens a lot of opportunities:

  • Allowing users to read data from a subset of an byte[] array (e.g. starting at index 10 and a length of 42), without having to copy that subset to a new array (which has a performance impact)
  • Improving the performance of deserializing binary property lists.
  • ...

This PR adds support for reading property lists form those types to plist-cil.

It comes with a couple of drawbacks, though. That includes:

  • dropping support for 'old' versions of .NET Core (netstandard1.x and netcoreapp1.x). It appears there's a big push to get everyone to use at least netstandard2.0, so that should be OK
  • dropping support for .NET 4.0 (.NET 4.5 is still supported, though)
  • adding a dependency on System.Memory for the .NET Framework versions

Supporting .NET Framework without adding a dependency on System.Memory and still adding support for Span<byte> would mean duplicating a lot of code, and I'm not sure it's worth it.

Would this be a problem for you?

**Original Pull Request:** https://github.com/claunia/plist-cil/pull/36 **State:** closed **Merged:** Yes --- We're doing a performance review of our application and are trying to make sure of the new `Span<byte>` and `ReadOnlySpan<byte>` types which are new in .NET land. For plist-cil, working with `Span<byte>` opens a lot of opportunities: - Allowing users to read data from a subset of an `byte[]` array (e.g. starting at index 10 and a length of 42), without having to copy that subset to a new array (which has a performance impact) - Improving the performance of deserializing binary property lists. - ... This PR adds support for reading property lists form those types to plist-cil. It comes with a couple of drawbacks, though. That includes: - dropping support for 'old' versions of .NET Core (`netstandard1.x` and `netcoreapp1.x`). It appears there's a big push to get everyone to use at least `netstandard2.0`, so that should be OK - dropping support for .NET 4.0 (.NET 4.5 is still supported, though) - adding a dependency on System.Memory for the .NET Framework versions Supporting .NET Framework without adding a dependency on System.Memory and still adding support for `Span<byte>` would mean duplicating a lot of code, and I'm not sure it's worth it. Would this be a problem for you?
claunia added the pull-request label 2026-01-30 21:26:59 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: claunia/plist-cil#63