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

Use List<T> instead of Array for Json object #2081

Merged
merged 1 commit into from
Apr 3, 2025

Conversation

BrennanConroy
Copy link
Member

This will use the List converter which avoids STJ internally creating a list just to call ToArray to give it back to us.

Allocation rate went from ~2.6B/sec to ~2.4B/sec

@sebastienros
Copy link
Member

Do you mean that in STJ deserializing an array will always use an intermediate list?

@BrennanConroy
Copy link
Member Author

Do you mean that in STJ deserializing an array will always use an intermediate list?

I won't claim "always". But using the debugger I followed it into the list creation and then ToArraying the list.

@BrennanConroy BrennanConroy merged commit e6cba6d into main Apr 3, 2025
2 checks passed
@BrennanConroy BrennanConroy deleted the BrennanConroy-patch-1 branch April 3, 2025 00:29
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