sebbASF edited a comment on pull request #118:
URL: https://github.com/apache/commons-io/pull/118#issuecomment-665748884


   It occurs to me that the code is effectively buffering the output from a 
BufferedReader (or BufferedInputStream).
   One would expect these classes to be reasonably fast, however the JVM has to 
do locking and other checks in order to support multi-threading. It has to do 
this for each read() call.
   
   Rather than implement the buffering directly in the compare methods, it 
might be better to implement a generic, non-threadsafe buffered reader/stream 
that can be used in situations such as these. [No need to wrap the original 
input in a buffered version first]. It would be a non-threadsafe version of 
BufferedReader/InputStream.
   
   The original code should then work without any change other than to  add the 
filter.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to