Browse Source
Most callers/users of TemporaryBuffer are sizing the in-memory portion large enough that most outputs fit into RAM. With this assumption they don't pay close attention to the size of IOs being written, as it "should" just be a copy from one byte array to another. Overflow sets up a local file handle, which is costly to write to for small IO units. Wrap the local file in a BufferedOutputStream to combine small writes together. Larger writes can still bypass the buffer as BOS automatically avoids copying for larger writes. Change-Id: I09f4136dd65c48830cfda86d9101bc647581018astable-4.1
Shawn Pearce
10 years ago
1 changed files with 2 additions and 1 deletions
Loading…
Reference in new issue