Skip to content

Commit

Permalink
+ using init sized ArrayList instead of LinkedList in BufferedStandar…
Browse files Browse the repository at this point in the history
…dOutput
  • Loading branch information
q3769 committed May 8, 2023
1 parent fd8f290 commit 0882be4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<groupId>io.github.elf4j</groupId>
<artifactId>elf4j-engine</artifactId>
<version>8.0.2</version>
<version>8.0.3</version>
<packaging>jar</packaging>
<name>elf4j-engine</name>
<description>A stand-alone Java log engine implementing the ELF4J (Easy Logging Facade for Java) API</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
import java.io.UncheckedIOException;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.LinkedList;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
Expand Down Expand Up @@ -115,7 +115,7 @@ private PollingBytesWriter(int batchSize) {
@Override
public void run() {
while (!stopped) {
List<byte[]> pollBatch = new LinkedList<>();
List<byte[]> pollBatch = new ArrayList<>(this.batchSize);
buffer.drainTo(pollBatch, batchSize);
synchronized (byteArrayOutputStream) {
byteArrayOutputStream.reset();
Expand Down

0 comments on commit 0882be4

Please sign in to comment.