Github user DaGeRe commented on a diff in the pull request:

    https://github.com/apache/maven-surefire/pull/167#discussion_r154208805
  
    --- Diff: 
surefire-api/src/main/java/org/apache/maven/surefire/booter/ForkingRunListener.java
 ---
    @@ -200,14 +200,8 @@ void sendProps()
         @Override
         public void writeTestOutput( byte[] buf, int off, int len, boolean 
stdout )
         {
    -        byte[] header = stdout ? stdOutHeader : stdErrHeader;
    -        byte[] content =
    -            new byte[buf.length * 3 + 1]; // Hex-escaping can be up to 3 
times length of a regular byte.
    -        int i = escapeBytesToPrintable( content, 0, buf, off, len );
    -        content[i++] = (byte) '\n';
    -        byte[] encodeBytes = new byte[header.length + i];
    -        System.arraycopy( header, 0, encodeBytes, 0, header.length );
    -        System.arraycopy( content, 0, encodeBytes, header.length, i );
    +        final byte[] header = stdout ? stdOutHeader : stdErrHeader;
    +        final byte[] encodeBytes = escapeBytesToPrintable( header, buf, 
off, len );
    --- End diff --
    
    In my experiments, many calls of PrintStream#write lead to a heavily 
decreased performance compared to sending bigger arrays to the PrintStream. 
Therefore, I constructed a big array every time, and this needed differend 
handling.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to