googleapis / googleapis/google-cloud-node

Performance impact of calling JSON.stringify in loadProtoJSON

Open
#7,698 0 comments 0 reactions 0 assignees View on GitHub
library: google-cloud-node-core size: l type: feature request
Dominant language
TypeScript
Stars
3.2k
Forks
712
Avg merge
2d 3h
Merged PRs (30d)
99

Description

We're using the compute engine InstancesClient and notice that every time we create an instance of it we spend a bunch of time in JSON.stringify as it's generating a 1.4 MB object. (This is running in a .333 vCPU cloud function.)

This is the call stack:
```
at GrpcClient.loadProtoJSON (/workspace/node_modules/google-gax/build/src/fallback.js:117:38)
at new InstancesClient (/workspace/node_modules/@google-cloud/compute/build/src/v1/instances_client.js:149:38)
```

Maybe that can be optimized somehow?

![Screenshot 2024-12-30 at 09 15 39](https://github.com/user-attachments/assets/e78590f5-1318-4b13-a4cc-5c1395376051)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.