Skip to content

Conversation

@Tarmil
Copy link
Owner

@Tarmil Tarmil commented Jun 9, 2025

Implement specialized converters for struct and ref pairs, triplets and quadruplets. This avoids reflection, saving all extraneous allocations and some time too.

For example when deserializing an (int * bool) pair:

Method Mean Error StdDev Gen0 Allocated
StructGeneric 409.1 ns 1.59 ns 1.48 ns 0.0081 112 B
StructSpecialized 367.2 ns 1.57 ns 1.39 ns - -
RefGeneric 417.9 ns 1.25 ns 1.11 ns 0.0081 112 B
RefSpecialized 383.0 ns 1.47 ns 1.23 ns 0.0014 24 B

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.

2 participants