@@ -87,27 +87,27 @@ public enum Includes {
87
87
88
88
@ SuppressWarnings ("unused" )
89
89
public static void runQuickNoAsserts (Array <Class <?>> groups , Includes ... includes ) {
90
- run (5 , 5 , 10 , ForkJvm . ENABLE , VerboseMode .NORMAL , Assertions . DISABLE , PrintInlining .DISABLE , groups , includes ).print ();
90
+ run (5 , 5 , 10 , VerboseMode .NORMAL , PrintInlining .DISABLE , groups , includes ).print ();
91
91
}
92
92
93
93
@ SuppressWarnings ("unused" )
94
94
public static void runNormalNoAsserts (Array <Class <?>> groups , Includes ... includes ) {
95
- run (7 , 7 , 300 , ForkJvm . ENABLE , VerboseMode .NORMAL , Assertions . DISABLE , PrintInlining .DISABLE , groups , includes ).print ();
95
+ run (7 , 7 , 300 , VerboseMode .NORMAL , PrintInlining .DISABLE , groups , includes ).print ();
96
96
}
97
97
98
98
@ SuppressWarnings ("unused" )
99
99
public static void runSlowNoAsserts (Array <Class <?>> groups , Includes ... includes ) {
100
- run (15 , 15 , 400 , ForkJvm . ENABLE , VerboseMode .EXTRA , Assertions . DISABLE , PrintInlining .DISABLE , groups , includes ).print ();
100
+ run (15 , 15 , 400 , VerboseMode .EXTRA , PrintInlining .DISABLE , groups , includes ).print ();
101
101
}
102
102
103
- private static BenchmarkPerformanceReporter run (int warmupIterations , int measurementIterations , int millis , ForkJvm forkJvm , VerboseMode silent , Assertions assertions , PrintInlining printInlining , Array <Class <?>> groups , Includes [] includes ) {
103
+ private static BenchmarkPerformanceReporter run (int warmupIterations , int measurementIterations , int millis , VerboseMode silent , PrintInlining printInlining , Array <Class <?>> groups , Includes [] includes ) {
104
104
final Array <String > includeNames = Array .of (includes .length == 0 ? Includes .values () : includes ).map (Includes ::toString );
105
105
final Array <String > classNames = groups .map (Class ::getCanonicalName );
106
- final Array <RunResult > results = run (warmupIterations , measurementIterations , millis , forkJvm , silent , assertions , printInlining , classNames , includeNames );
106
+ final Array <RunResult > results = run (warmupIterations , measurementIterations , millis , silent , printInlining , classNames , includeNames );
107
107
return BenchmarkPerformanceReporter .of (includeNames , classNames , results );
108
108
}
109
109
110
- private static Array <RunResult > run (int warmupIterations , int measurementIterations , int millis , ForkJvm forkJvm , VerboseMode verboseMode , Assertions assertions , PrintInlining printInlining , Array <String > classNames , Array <String > includeNames ) {
110
+ private static Array <RunResult > run (int warmupIterations , int measurementIterations , int millis , VerboseMode verboseMode , PrintInlining printInlining , Array <String > classNames , Array <String > includeNames ) {
111
111
try {
112
112
final ChainedOptionsBuilder builder = new OptionsBuilder ()
113
113
.shouldDoGC (true )
@@ -119,10 +119,10 @@ private static Array<RunResult> run(int warmupIterations, int measurementIterati
119
119
.warmupIterations (warmupIterations )
120
120
.measurementTime (TimeValue .milliseconds (millis ))
121
121
.measurementIterations (measurementIterations )
122
- .forks (forkJvm . forkCount )
122
+ .forks (1 )
123
123
/* We are using 4Gb and setting NewGen to 100% to avoid GC during testing.
124
124
Any GC during testing will destroy the iteration (i.e. introduce unreliable noise in the measurement), which should get ignored as an outlier */
125
- .jvmArgsAppend ("-XX:+UseG1GC" , "-Xss100m" , "-Xms4g" , "-Xmx4g" , "-XX:MaxGCPauseMillis=1000" , "-XX:+UnlockExperimentalVMOptions" , "-XX:G1NewSizePercent=100" , "-XX:G1MaxNewSizePercent=100" , assertions . vmArg );
125
+ .jvmArgsAppend ("-XX:+UseG1GC" , "-Xss100m" , "-Xms4g" , "-Xmx4g" , "-XX:MaxGCPauseMillis=1000" , "-XX:+UnlockExperimentalVMOptions" , "-XX:G1NewSizePercent=100" , "-XX:G1MaxNewSizePercent=100" , "-disableassertions" );
126
126
127
127
final String includePattern = includeNames .mkString ("\\ ..*?\\ b(" , "|" , ")_" );
128
128
classNames .forEach (name -> builder .include (name + includePattern ));
@@ -137,27 +137,6 @@ Any GC during testing will destroy the iteration (i.e. introduce unreliable nois
137
137
}
138
138
}
139
139
140
- /* Options */
141
- private enum ForkJvm {
142
- ENABLE (1 );
143
-
144
- final int forkCount ;
145
-
146
- ForkJvm (int forkCount ) {
147
- this .forkCount = forkCount ;
148
- }
149
- }
150
-
151
- private enum Assertions {
152
- DISABLE ("-disableassertions" );
153
-
154
- final String vmArg ;
155
-
156
- Assertions (String vmArg ) {
157
- this .vmArg = vmArg ;
158
- }
159
- }
160
-
161
140
private enum PrintInlining {
162
141
ENABLE ,
163
142
DISABLE
0 commit comments