Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Expand comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
clokep committed Aug 19, 2020
1 parent d54f1f5 commit 2afe301
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions synapse/http/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,11 @@ def resumeProducing(self) -> None:
while not self._paused:
# Get the next chunk and write it to the request.
#
# The output of the JSON encoder is coalesced until min_chunk_size is
# reached. (This is because JSON encoders produce a very small output
# per iteration.)
# The output of the JSON encoder is buffered and coalesced until
# min_chunk_size is reached. This is because JSON encoders produce
# very small output per iteration and the Request object converts
# each call to write() to a separate chunk. Without this there would
# be an explosion in bytes written (e.g. b"{" becoming "1\r\n{\r\n").
#
# Note that buffer stores a list of bytes (instead of appending to
# bytes) to hopefully avoid many allocations.
Expand Down

0 comments on commit 2afe301

Please sign in to comment.