This repository has been archived by the owner on Sep 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
16 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is absolutely unnecessary, flawed and causes duplications of memory streams in the following places
await response.Content.LoadIntoBufferAsync();
in ServerCompressionHandler.SendAsync on line 142in BaseCompressor .Compress line 47 to 50
in BaseCompressor .Compress on line 54 and line 55
in BaseCompressor .Compress on line 57 and line 58
in CompressedContent.SerializeToStreamAsync on line 75 and line 81
This is a greatly flawed implementation that we need to fix.
For small contents, the server memory footprint negligible, but for a 10 MB file, approximately 30 MB of data is held in memory before sending to response stream.
This hinders file streaming, and may not even work for bigger files ex. 100MB
Proposed Fixes
await response.Content.LoadIntoBufferAsync();
should be removed (or only used small filesif size is computable)
and
Will give huge performance boost, both on memory usage and latency(due to buffering)