Re: Enhancement proposal regarding bufferization of InputStream

2021-04-16 Thread Сергей Цыпанов
Hi Roger, > Are you taking into account that for many reads the data is not copied > into the local buffer. > See the comments in BufferedInputStream.read1: 277:280? sure, I'm aware of this optimization. The buffer however is always allocated as BufferedInputStream instantiated, waisting by defa

Re: Enhancement proposal regarding bufferization of InputStream

2021-04-15 Thread Roger Riggs
Hi Sergey, Are you taking into account that for many reads the data is not copied into the local buffer. See the comments in BufferedInputStream.read1: 277:280? How much is the slowdown, when BufferedInputStreams are chained? Thanks, Roger On 4/15/21 7:08 AM, Pavel Rappo wrote: On 15 Apr 20

Re: Enhancement proposal regarding bufferization of InputStream

2021-04-15 Thread Pavel Rappo
> On 15 Apr 2021, at 08:33, Сергей Цыпанов wrote: > > Hello, > > buffering with j.i.BufferedInputStream is a handy way to improve performance > of IO operations. > However in many cases buffering is redundant. Consider this code snippet from > Spring Framework: > > static ClassReader getClas

Enhancement proposal regarding bufferization of InputStream

2021-04-15 Thread Сергей Цыпанов
Hello, buffering with j.i.BufferedInputStream is a handy way to improve performance of IO operations. However in many cases buffering is redundant. Consider this code snippet from Spring Framework: static ClassReader getClassReader(Resource rsc) throws Exception { try (var is = new BufferedInp