Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure #36

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

Restructure #36

wants to merge 3 commits into from

Conversation

StringEpsilon
Copy link
Owner

@StringEpsilon StringEpsilon commented May 6, 2023

Trying to figure out a better structure for the individual bits of the deserializer.

Currently this has a lot of duplicate code and I suspect it to be slower to do an increase in allocation. But the code is a lot more navigable and hopefully easier to maintain in a readable state and optimize in the future for better performance.

@StringEpsilon
Copy link
Owner Author

Quick and dirty benchmark:

main:

|               Method |       Mean |     Error |   StdDev |
|--------------------- |-----------:|----------:|---------:|
|             Implicit | 2,843.5 ns | 235.01 ns | 12.88 ns |
| Explict_List_Strings |   666.7 ns |  21.10 ns |  1.16 ns |
|   Explict_List_Bools |   528.7 ns |  22.27 ns |  1.22 ns |
|   Explict_List_Nulls |   516.8 ns |  23.42 ns |  1.28 ns |
| Enum_With_Attributes | 1,539.7 ns | 163.55 ns |  8.96 ns |

This branch:

|               Method |       Mean |     Error |  StdDev |
|--------------------- |-----------:|----------:|--------:|
|             Implicit | 3,424.4 ns | 114.30 ns | 6.27 ns |
| Explict_List_Strings |   750.7 ns |  59.25 ns | 3.25 ns |
|   Explict_List_Bools |   594.9 ns | 103.94 ns | 5.70 ns |
|   Explict_List_Nulls |   627.8 ns |  27.05 ns | 1.48 ns |
| Enum_With_Attributes | 1,531.0 ns |  18.03 ns | 0.99 ns |

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.

None yet

1 participant