You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 15, 2024. It is now read-only.
Android and iOS support the Span feature. In some instances we can really cut down on allocation with the Span feature. This would also become the default path once .NET 5 is released this year, as UWP will then finally support .NET Standard 2.1. Be aware that this could be at most one year off.
API Changes
A complete review would be required. This should also include looking at System.Buffers. I did that already, and there are no glaringly obvious ways to benefit from this feature sadly. Only one instance came up, and I am pretty sure it does not work as it occurs in _SecureStorage.Android, where the api could rely on exact buffer size. There would also need to be an audit where we can expose two different return types.
Intended Use Case
Reduce useless allocations, be future proof.
The text was updated successfully, but these errors were encountered:
The thing which prompted this ticket was the WebUtils.shared.cs ParseQueryString where we do some string manipulation. Due to some substring operations I thought this was a good candidate. The savings here are not immense though as we have to materialize some spans in the end to populate our Dictionary<string,string>. This will probably also be our primary saving, string manipulation. As far as I am aware we only ever once create a byte array, so for that we really will not be getting any savings. Strings is where it is at for us
I think at this point it's safe to say that this won't be making it's way into Xamarin.Essentials anymore. Keep your eye on .NET MAUI for all new development! Thanks for all input and efforts here.
Summary
Android and iOS support the Span feature. In some instances we can really cut down on allocation with the Span feature. This would also become the default path once .NET 5 is released this year, as UWP will then finally support .NET Standard 2.1. Be aware that this could be at most one year off.
API Changes
A complete review would be required. This should also include looking at System.Buffers. I did that already, and there are no glaringly obvious ways to benefit from this feature sadly. Only one instance came up, and I am pretty sure it does not work as it occurs in _SecureStorage.Android, where the api could rely on exact buffer size. There would also need to be an audit where we can expose two different return types.
Intended Use Case
Reduce useless allocations, be future proof.
The text was updated successfully, but these errors were encountered: