Skip to content

Conversation

@stephentoub
Copy link
Member

The XML deserializer tracks for each property whether it's already been seen in the input being deserialized, and to do that the reader allocates a bool[] array. We can instead stackalloc that for a reasonable number of properties.

The XML deserializer tracks for each property whether it's already been seen in the input being deserialized, and to do that the reader allocates a bool[] array.  We can instead stackalloc that for a reasonable number of properties.
@stephentoub stephentoub force-pushed the xmlserializationboolarray branch from f7f432f to 6e1ab40 Compare March 23, 2022 22:07
Copy link
Member

@StephenMolloy StephenMolloy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, though this ILGen stuff always feels fragile to me. Maybe fragile is the wrong word. Easy to get wrong? Hard to debug? Anyway, I'm curious what prompted this PR. Is there another issue that is impacted by not using Span here?

@stephentoub
Copy link
Member Author

Thanks. @StephenMolloy and I spoke offline.

@stephentoub stephentoub merged commit 1f90082 into dotnet:main Mar 25, 2022
@stephentoub stephentoub deleted the xmlserializationboolarray branch March 25, 2022 01:38
radekdoulik pushed a commit to radekdoulik/runtime that referenced this pull request Mar 30, 2022
…66914)

The XML deserializer tracks for each property whether it's already been seen in the input being deserialized, and to do that the reader allocates a bool[] array.  We can instead stackalloc that for a reasonable number of properties.
@ghost ghost locked as resolved and limited conversation to collaborators Apr 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants