Skip to content

Remove intermediate strings in json deserialization to reduce memory usage#203

Open
alecrodden wants to merge 1 commit intogoogleapis:mainfrom
alecrodden:more-memory-efficient-json-deserialization
Open

Remove intermediate strings in json deserialization to reduce memory usage#203
alecrodden wants to merge 1 commit intogoogleapis:mainfrom
alecrodden:more-memory-efficient-json-deserialization

Conversation

@alecrodden
Copy link

Improvements made:

  • Replaced multiple instances of HttpContent.ReadAsStringAsync() + JsonNode.Parse(string) with HttpContent.ReadAsStreamAsync() + JsonNode.ParseAsync(Stream).
  • Replaced multiple instances of JsonSerializer.Deserialize<T>(responseNode.ToString()) with JsonSerializer.Deserialize<T>(responseNode).

@google-cla
Copy link

google-cla bot commented Feb 3, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@shivvaam0001 shivvaam0001 self-assigned this Feb 9, 2026
@shivvaam0001 shivvaam0001 added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Feb 9, 2026
@shivvaam0001
Copy link

Hi @alecrodden
Thank you for your contribution. Please check the failing checks and update the same.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants