You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The byte array in `ByteArrayOutputStream` doubles in size every time
capacity is exhausted - for an object just over 1GB in size, the buffer
will eventually grow to 2GB in size - unnecessarily large, and involving
a lot of array copies (`ceil(log_2 (N/32))` copies).
https://github.com/openjdk/jdk/blob/218829e0a2a3ae5599b81733df53557966392033/src/java.base/share/classes/java/io/ByteArrayOutputStream.java#L100-L101
If we just tell the Content Length to initialise the `ByteArrayOutputStream`
with a byte array of the right size, the array will never get bigger than it
needs to be - and it won't have do array-resizing either.
Copy file name to clipboardExpand all lines: src/main/java/com/madgag/aws/sdk/async/responsebytes/awssdk/core/async/AsyncResponseTransformerAlternative.java
Copy file name to clipboardExpand all lines: src/main/java/com/madgag/aws/sdk/async/responsebytes/awssdk/core/internal/async/ByteArrayAsyncResponseTransformerAlternative.java
0 commit comments