Open habbes opened 9 months ago
@habbes what framework version are you targeting on those tests?
@julealgon the tests were running on net7.0, should try them on net8.0 as well.
@julealgon the tests were running on net7.0, should try them on net8.0 as well.
I was going to suggest that considering how many perf enhancements there were in .NET8. Would be curious to compare the results.
During serialization, a relatively high amount of CPU is used to create
ODataProperty
instances that are used to populateODataResource
objects. This is performed in theODataSerializerPropertyHelper.CreateProperty
method.The most of the cost come's from the property's EDM serializer's call to
CreateODataValue
.The
ODataPrimitiveSerializer.CreateODataValue
:EdmTypeSemantics
, see: https://github.com/OData/odata.net/issues/2807ODataPrimitiveSerializer.ConverUnsupportedPrimitives
seems to be expensive due to its reliance onType.GetTypeCode()
. We should assess whether there are more efficient ways to handle CLR primitive types that are not part of ODL's core primitive types.The
ODataEnumSerializer.CreateODataValue
:ClrEnumMemberAnnotation
from the theIEdmModel
annotations cache. This model's annotation cache is constant performance hog that does not seem easy to optimize.Enum.ToString()