-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve buffer management throughout the load/fetch and parse lifecyc…
…le (#2186) * Introduces SoftPool A SoftPool is a ThreadLocal SofReference Stack of <T>, with borrow and release methods. Allows simple recycling of objects between uses, and for those to be reaped when inactive. * Refactored bufferUp in CharacterReader Removed the use of a backing BufferedInputReader, which was redundant and creating large char array buffers, and reuse the char[] buffer via SoftPool. * Maintain the string flyweight cache between runs in CharacterReader * Updated ControllableInputStream to use new SimpleBufferedInput, instead of BufferedInputStream, so we can reuse those byte[] buffers. Also, those are only borrowed/created on the first need for the buffer; otherwise fill reads cascade down to the underlying stream. And removes synchronized / lock sections, as this is not passed between threads concurrently. * Reduced the DefaultBufferSize to 8K from 32K * In DataUtil, when reading ahead to detect the charset, instead of buffering into a new ByteBuffer, reuse the ControllableInputStream. * Simplify BOM character skip Overall, heap allocations and GC during the read & parse phase are down between -6% and -89%, and throughput improved up to +143%.
- Loading branch information
Showing
20 changed files
with
719 additions
and
300 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 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
Oops, something went wrong.