Large Google Sheets API responses are currently pretty-printed by default. For machine-to-machine use, the additional whitespace and line breaks provide no benefit while increasing response size and I/O. When processing large responses, this can also contribute to unnecessary memory usage.
Describe the solution you'd like
Change the default value of prettyPrint from true to false for the Sheets API discovery document.
Describe alternatives you've considered
The current workaround is to explicitly pass prettyPrint=False to every request. This works, but requires application code to opt out of an unnecessary default and is easy to miss, especially in codebases making many Sheets API requests.
Another option would be to modify the client code to inject prettyPrint=False, but changing the API discovery document's default seems simpler and more consistent with the intended API behavior.
Additional context
This is particularly relevant for applications processing large Sheets responses programmatically. Avoiding pretty printing would reduce the amount of data transferred and processed, as well as the memory required to hold the response in memory. For large responses, this can also help reduce peak process RSS.
A small change from:
"prettyPrint": {
"default": "true"
}
to:
"prettyPrint": {
"default": "false"
}
would be sufficient.
As a bonus, this would make the default more appropriate for API clients, where responses are consumed programmatically rather than displayed directly to users.
Large Google Sheets API responses are currently pretty-printed by default. For machine-to-machine use, the additional whitespace and line breaks provide no benefit while increasing response size and I/O. When processing large responses, this can also contribute to unnecessary memory usage.
Describe the solution you'd like
Change the default value of
prettyPrintfromtruetofalsefor the Sheets API discovery document.Describe alternatives you've considered
The current workaround is to explicitly pass
prettyPrint=Falseto every request. This works, but requires application code to opt out of an unnecessary default and is easy to miss, especially in codebases making many Sheets API requests.Another option would be to modify the client code to inject
prettyPrint=False, but changing the API discovery document's default seems simpler and more consistent with the intended API behavior.Additional context
This is particularly relevant for applications processing large Sheets responses programmatically. Avoiding pretty printing would reduce the amount of data transferred and processed, as well as the memory required to hold the response in memory. For large responses, this can also help reduce peak process RSS.
A small change from:
to:
would be sufficient.
As a bonus, this would make the default more appropriate for API clients, where responses are consumed programmatically rather than displayed directly to users.