Github user markap14 commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1202#discussion_r88325073
--- Diff:
nifi-commons/nifi-utils/src/main/java/org/apache/nifi/stream/io/BufferedInputStream.java
---
@@ -16,19 +16,445 @@
*/
package org.apache.nifi.stream.io;
+import java.io.IOException;
import java.io.InputStream;
/**
* This class is a slight modification of the BufferedInputStream in the
java.io package. The modification is that this implementation does not provide
synchronization on method calls, which means
* that this class is not suitable for use by multiple threads. However,
the absence of these synchronized blocks results in potentially much better
performance.
--- End diff --
You're welcome to create your own benchmarks. My experience is that it
causes tremendous performance implications when used in 'critical sections' of
code. For example, if you have code that reads 1 GB of data, one byte at a
time, you'd be crossing a synchronization barrier over 1 billion times. This
can equate to several seconds spent simply crossing that barrier, even when
using a single thread.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---