Skip to content

Commit 1f12115

Browse files
committed
Optimize single & batch query response writers to reduce memory allocation overhead caused by the servlet.
1 parent 6a52a38 commit 1f12115

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

graphql-java-servlet/src/main/java/graphql/kickstart/servlet/BatchedQueryResponseWriter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ public void write(HttpServletRequest request, HttpServletResponse response) thro
2323
response.setContentType(HttpRequestHandler.APPLICATION_JSON_UTF8);
2424
response.setStatus(HttpRequestHandler.STATUS_OK);
2525

26-
// Use direct serialization to byte arrays and avoid any string concatenation to avoid save
27-
// multiple GiB of memory allocation during large response processing.
26+
// Use direct serialization to byte arrays and avoid any string concatenation to save multiple
27+
// GiB of memory allocation during large response processing.
2828
List<byte[]> serializedResults = new ArrayList<>(2 * results.size() + 1);
2929

3030
if (results.size() > 0) {

0 commit comments

Comments
 (0)