-
Enhancement
-
Resolution: Unresolved
-
P4
-
tbd
ByteArrayOutputStream (along with some other classes) uses an exponential growth factor of 2 for its internal buffer, i.e. it doubles in size when it exceeds its existing capacity.
Other JDK classes use a factor of 1.5, e.g. ArrayList, StringLatin1 or 2 separate values depending on the absolute size (PriorityBlockingQueue).
Should we standardize on one value?
I haven't found any discussion or reasoning on the two different values specifically in JDK, though there's plenty of discussion externally (e.g. https://en.wikipedia.org/wiki/Dynamic_array#Growth_factor).
Other JDK classes use a factor of 1.5, e.g. ArrayList, StringLatin1 or 2 separate values depending on the absolute size (PriorityBlockingQueue).
Should we standardize on one value?
I haven't found any discussion or reasoning on the two different values specifically in JDK, though there's plenty of discussion externally (e.g. https://en.wikipedia.org/wiki/Dynamic_array#Growth_factor).