changeset 46:848553498e63

Add more buffer to benchmark writers.
author shade
date Mon, 27 May 2013 18:54:19 +0400
parents 3a3f26e282ad
children e841c952e578
files jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java	Mon May 27 18:35:06 2013 +0400
+++ b/jmh-core/src/main/java/org/openjdk/jmh/processor/internal/GenerateMicroBenchmarkProcessor.java	Mon May 27 18:54:19 2013 +0400
@@ -50,7 +50,9 @@
 import javax.lang.model.util.Types;
 import javax.tools.Diagnostic.Kind;
 import javax.tools.JavaFileObject;
+import java.io.BufferedWriter;
 import java.io.IOException;
+import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
 import java.util.*;
 import java.util.concurrent.TimeUnit;
@@ -248,7 +250,7 @@
 
             // Create file and open an outputstream
             JavaFileObject jof = processingEnv.getFiler().createSourceFile(generatedPackageName + "." + generatedClassName, clazz);
-            PrintWriter writer = new PrintWriter(jof.openOutputStream());
+            PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(jof.openOutputStream()), 64*1024), false);
 
             // Write package and imports
             writer.println("package " + generatedPackageName + ';');