On Mon, 11 Apr 2022 22:58:19 GMT, Roger Riggs <rri...@openjdk.org> wrote:
> Is this change proposed as the result of some experience with particular apps > and streams or just observation of the implementation? just observation of the implementation of InputStream class and Reader class, and somehow wonder why there be different handling in skip to these 2 classes. > Is there any information about what kind of underlying streams do not support > skip directly and what is the distribution of sizes expected to be 'skipped'? > GIven the object instance overhead of an array, I'd be inclined to suggest a > minimum size that would cover all of the 'small' skipping that could occur. > And if that's not big enough, jump to the MAX_SKIP_BUFFER_SIZE. To keep the > code simple, I'd start at 128bytes and jump to the max if that's not big > enough. There is precious little actual information available to fine tune. It whould make the problem @liach said above heavier. For example, if people just invoke 129, then the imput stream object hold a 8192 length array until it die. That sounds much too memory wasting. ------------- PR: https://git.openjdk.java.net/jdk/pull/5872