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
Merging internal commits for release/8.0 (#108679)
* Fix performance issue when deserializing large payloads in JsonObject extension data.
Bug fix to address performance issues when deserializing large payloads in `JsonObject` extension data.
Mitigates performance issues by optimizing the deserialization process for large `JsonObject` extension data properties.
- Added `LargeJsonObjectExtensionDataSerializationState` class in `System.Text.Json.Serialization.Converters` to handle large payloads efficiently.
- Updated `JsonObjectConverter` to use the new state class for large objects.
- Modified `ObjectDefaultConverter`, `ObjectWithParameterizedConstructorConverter`, and `ReadStackFrame` to complete deserialization using the new state class.
- Added tests in `JsonObjectTests` to validate the performance improvements with large payloads.
* ZipArchive: Improve performance of removing extra fields
This improves the performance of removing extra fields in the ZipArchive by optimizing the removal process.
`src/libraries/System.IO.Compression/src/System/IO/Compression/ZipBlocks.cs`: Replaced multiple iterations and list operations with a single `RemoveAll` call to enhance efficiency.
* Packaging: Port fix for GetParts from .NETFramework
This ports a fix for the `GetParts` method to improve part URI handling and collision detection.
`src/libraries/System.IO.Packaging/src/System/IO/Packaging/Package.cs`: Added sorting of parts array to ensure proper order, introduced a dictionary and list to track parts and detect collisions, and implemented a new method `CopyPartDictionaryToPartList` to copy parts to `_partList`.
* Merged PR 41316: Use Marvin32 instead of xxHash32 in COSE hash codes
* Microsoft.Extensions.Caching.Memory: use Marvin for keys on down-level TFMs
Note that Microsoft.Extensions.Caching.Memory is deployed OOB via NuGet, and multi-targets including support for netfx and ns2.0
Marvin is the string hashing used in modern .NET (https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Marvin.cs); this change extends this behaviour to `string` keys when used with `MemoryCache` - noting that in many scenarios we *expect* the key to be a `string` (even though other types are allowed)
To do this we:
- ~~add a custom key equality comparer for use with `ConcurrentDictionary<object, CacheEntry>` (we do this on all TFMs, replacing the need for the dynamic lookup via `EqualityComparer<TKey>.Default`)~~
- split the internal dictionary into 2 - one for `string`, one for everything else
- in down-level TFMs only, provide a custom `string` key comparer with `MarvinHash` enabled (local snapshot since not available)
This gives us Marvin everywhere, and Marvin+rehash on netcore TFMs (rehash requires `TKey` === `string`)
---------
Co-authored-by: Mirroring <[email protected]>
Co-authored-by: Eirik George Tsarpalis <[email protected]>
Co-authored-by: Eric St. John <[email protected]>
Co-authored-by: Jeremy Barton <[email protected]>
Co-authored-by: Marc Gravell <[email protected]>
0 commit comments