daniel-petrov-flows opened a new pull request, #4078: URL: https://github.com/apache/avro/pull/4078
## What is the purpose of the change Avoid boxing the nullable sort-order enum in `Field.GetHashCode()`. Confluent’s datum-reader cache hashes both schemas on each lookup, repeating this allocation across their fields. Full decode benchmarks with two synthetic nested records (348 and 540 bytes), warm caches, and an in-memory Schema Registry saved 1,584 to 2,736 bytes per message, reducing allocations by 29 to 37%. Hash behavior is preserved, including zero for `null`, as documented by [Nullable<T>.GetHashCode()](https://learn.microsoft.com/en-us/dotnet/api/system.nullable-1.gethashcode#returns). ## Verifying this change All 163 existing schema tests passed on .NET 10: ```bash dotnet test lang/csharp/src/apache/test/Avro.test.csproj -f net10.0 --filter "FullyQualifiedName~Avro.Test.SchemaTests" ``` ## Documentation - Does this pull request introduce a new feature? No. - If yes, how is the feature documented? Not applicable. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
