Skip to content

Introduce System.Nullable fast path - #369

Merged
agocke merged 2 commits into
serdedotnet:mainfrom
agocke:opt-nullable
Jul 1, 2026
Merged

Introduce System.Nullable fast path#369
agocke merged 2 commits into
serdedotnet:mainfrom
agocke:opt-nullable

Conversation

@agocke

@agocke agocke commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Right now deserializing System.Nullable has to go through multiple interface dispatch hops to finally get to the underlying type. This change allows for simplifying most of the dispatch logic -- the worst case only adds a ReadFieldStart/ReadFieldEnd pair.

The new pattern is that IDeserializer should provide a 'TryReadNull' fast path that proxies can use to quickly check for null, then bail out if needed.

agocke added 2 commits July 1, 2026 01:14
Right now deserializing System.Nullable has to go through multiple
interface dispatch hops to finally get to the underlying type. This
change allows for simplifying most of the dispatch logic -- the worst
case only adds a  pair.

The new pattern is that IDeserializer should provide a 'TryReadNull'
fast path that proxies can use to quickly check for null, then bail
out if needed.
@agocke
agocke merged commit c99df71 into serdedotnet:main Jul 1, 2026
1 check passed
@agocke
agocke deleted the opt-nullable branch July 1, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant