forked from facebookincubator/velox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add BufferedOutputStream (facebookincubator#12052)
Summary: Context: I plan to update the PrestoBatchVectorSerializer to write directly to the OutputStream rather than going through VectorStreams as I've seen this can greatly improve the speed. However, this ends up with many small writes to the OutputStream, which is typically a ByteOutputStream, so this leads to a lot of small allocations which is counter productive to the optimization I'm trying to make. To address this I add a BufferedOutputStream which wraps around another OutputStream, coalesces writes in a buffer, and flushes those as large writes to the wrapped OutputStream as the buffer fills up, or as needed. In my experiments I've seen the cost of the additional copy is far less then the cost of the tiny allocations. Differential Revision: D67997655
- Loading branch information
1 parent
9dcfd39
commit 5570b5e
Showing
3 changed files
with
88 additions
and
1 deletion.
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 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