Summary
This release focuses primarily on the following:
- Increasing support for System.Memory types such as
ReadOnlySpan<T> and Span<T>, especially on strings
- Normalizing behavior of
Dictionary<TKey, TValue>, SortedDictionary<TKey, TValue> and SortedSet<T> to be equivalent to .NET 8
- Reducing allocations by making use of the stack and/or array pool
- Removing support for old target frameworks
- Adding support for
net8.0
What's Changed
- Oct 2023 build updates by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/52
- J2N.Numerics: Extended Span<char> support to net45 and netstandard2.0 by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/53
- J2N.Threading.ThreadJob: Don't swallow exceptions when getting/setting Priority by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/50
- J2N.Character: Added ReadOnlySpan<char> overloads for working with codepoints by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/54
- J2N.Tests.Collections.TestBitSet.JDK8BSMethods: Enabled TestEquals() test, removed unnecessary variable initialization by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/55
- J2N.Character: Added overloads of ToChars() and ToString() to reduce allocations by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/56
- J2N.Text.StringBuilderExtensions: Added CopyTo(int, Span<char>, int) … by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/59
- PERFORMANCE: J2N.Text.StringBuilderExtensions: Optimizations by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/63
- PERFORMANCE: J2N.Text.CharArrayExtensions: Optimized CompareToOrdinal() by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/67
- PERFORMANCE: J2N.Character: Optimized CodePointAt(), CodePointBefore(), CodePointCount(), and OffsetByCodePoints() by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/65
- PERFORMANCE: J2N.Text.StringExtensions: Optimized CompareToOrdinal(), ContentEquals(), and RegionMatches() by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/66
- J2N.Text.StringBuilderExtensions::InsertCodePoint(): Fixed xml doc by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/71
- PERFORMANCE: J2N.Text.CharSequenceComparer: Optimized Compare(), Equals() and GetHashCode() implementations by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/70
- J2N.Text: Added ISpanAppendable interface and AppendableExtensions class by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/72
- J2N.Text.StringBuffer: Fixed bugs and added new APIs by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/73
- J2N.Text (CharArrayCharSequence + StringBuilderCharSequence + StringCharSequence): Optimized and fixed several bugs in the Equals() and CompareTo() overloads. by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/74
- PERFORMANCE: J2N.Text.StringBuilderCharSequence: Optimized and fixed several bugs with the IAppendable implementations by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/75
- J2N.Text: Added ValueStringBuilderIndexer for end users - optimizes iteration of StringBuilder via index by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/76
- J2N.Text.StringExtensions, J2N.Memory.MemoryExtensions: Added optimized ReverseText() methods by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/77
- J2N.Character: Added overloads of CodePointAt() and CodePointBefore() by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/78
- PERFORMANCE: Added target for net462 by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/79
- PERFORMANCE: J2N.Character::ToString(): Improved both memory usage and speed by using String.Create() and ArrayPool, when supported. by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/81
- J2N.Text.StringExtensions::ReverseText(): Use String.Create() for optimal performance, when supported by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/82
- PERFORMANCE: J2N.Character: Optimized ToUpper() and ToLower() and added ToUpperInvariant() and ToLowerInvariant() by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/84
- PERFORMANCE: Removed ValueStringBuilder and reworked methods that used it to use stack/array pool explicitly by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/85
- J2N.Text (CharArrayExtensions + StringBuilderExtensions + StringExtensions): Added ReadOnlySpan<char> overload of CompareToOrdinal() by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/86
- J2N.Text.StringBuilderExtensions: Added Replace() overload that accepts ReadOnlySpan<char> by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/87
- J2N.MemoryExtensions: Added IndexOf(codePoint) and LastIndexOf(codePoint) extension methods by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/88
- J2N.Text.StringExtensions: Added ReadOnlySpan<char> overload of ContentEquals() by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/89
- J2N.Text.StringExtensions: Added ReadOnlySpan<char> overload to RegionMatches() by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/90
- Added support for Span<T>/ReadOnlySpan<T> in net40 by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/92
- Removed tests and CI for Xamarin, as they are now obsolete by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/96
- Removed FEATURE_ARRAYPOOL by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/97
- Removed FEATURE_SPAN and FEATURE_READONLYMEMORY by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/98
- J2N.Collections: Added AsReadOnly() method to each dictionary and set by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/100
- PERFORMANCE: J2N.Text.StringBuilderExtensions::Replace(): Reuse expansion memory by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/101
- azure-pipelines.yml: Use deep clone for Nerdbank.GitVersioning by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/102
- J2N.Character: Added overload of ToChars() that accepts a Span<char> and returns ReadOnlySpan<char> by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/103
- J2N.Runtime.InteropServices: Added CollectionMarshal class by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/99
- Upgraded Dictionary<TKey, TValue> to use a low level (rather than a wrapped) implementation by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/104
- Added net8.0 target and tests (Fixes #94) by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/110
- Reverted breaking API changes for 2.1.0 so we don't have to bump to 3.0.0 by @NightOwl888 in https://github.com/NightOwl888/J2N/pull/113
Full Changelog: https://github.com/NightOwl888/J2N/compare/v2.0.0...v2.1.0