-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the two ideas in b/290807073 to reduce memory spikes during…
… string compression in `FileWriteAction`. * Presize the `ByteArrayOutputStream` more appropriately. This holds the compressed data, so presizing it to the number of uncompressed bytes can be way more space than needed. A code comment justifies the chosen presizing. * Use `StringUnsafe` to get a reference to the string's internal byte array instead of calling `getBytes()`, which makes a copy. PiperOrigin-RevId: 548132680 Change-Id: Id5eb02013e652ae2f0e47a750011491101738df8
- Loading branch information
1 parent
5eff703
commit 7966079
Showing
2 changed files
with
27 additions
and
10 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