View Javadoc
1   package org.apache.commons.io.jmh.jmh_generated;
2   
3   import java.util.List;
4   import java.util.concurrent.atomic.AtomicInteger;
5   import java.util.Collection;
6   import java.util.ArrayList;
7   import java.util.concurrent.TimeUnit;
8   import org.openjdk.jmh.annotations.CompilerControl;
9   import org.openjdk.jmh.runner.InfraControl;
10  import org.openjdk.jmh.infra.ThreadParams;
11  import org.openjdk.jmh.results.BenchmarkTaskResult;
12  import org.openjdk.jmh.results.Result;
13  import org.openjdk.jmh.results.ThroughputResult;
14  import org.openjdk.jmh.results.AverageTimeResult;
15  import org.openjdk.jmh.results.SampleTimeResult;
16  import org.openjdk.jmh.results.SingleShotResult;
17  import org.openjdk.jmh.util.SampleBuffer;
18  import org.openjdk.jmh.annotations.Mode;
19  import org.openjdk.jmh.annotations.Fork;
20  import org.openjdk.jmh.annotations.Measurement;
21  import org.openjdk.jmh.annotations.Threads;
22  import org.openjdk.jmh.annotations.Warmup;
23  import org.openjdk.jmh.annotations.BenchmarkMode;
24  import org.openjdk.jmh.results.RawResults;
25  import org.openjdk.jmh.results.ResultRole;
26  import java.lang.reflect.Field;
27  import org.openjdk.jmh.infra.BenchmarkParams;
28  import org.openjdk.jmh.infra.IterationParams;
29  import org.openjdk.jmh.infra.Blackhole;
30  import org.openjdk.jmh.infra.Control;
31  import org.openjdk.jmh.results.ScalarResult;
32  import org.openjdk.jmh.results.AggregationPolicy;
33  import org.openjdk.jmh.runner.FailureAssistException;
34  
35  import org.apache.commons.io.jmh.jmh_generated.IOUtilsContentEqualsInputStreamsBenchmark_jmhType;
36  public final class IOUtilsContentEqualsInputStreamsBenchmark_testStringRelease_2_8_0_jmhTest {
37  
38      byte p000, p001, p002, p003, p004, p005, p006, p007, p008, p009, p010, p011, p012, p013, p014, p015;
39      byte p016, p017, p018, p019, p020, p021, p022, p023, p024, p025, p026, p027, p028, p029, p030, p031;
40      byte p032, p033, p034, p035, p036, p037, p038, p039, p040, p041, p042, p043, p044, p045, p046, p047;
41      byte p048, p049, p050, p051, p052, p053, p054, p055, p056, p057, p058, p059, p060, p061, p062, p063;
42      byte p064, p065, p066, p067, p068, p069, p070, p071, p072, p073, p074, p075, p076, p077, p078, p079;
43      byte p080, p081, p082, p083, p084, p085, p086, p087, p088, p089, p090, p091, p092, p093, p094, p095;
44      byte p096, p097, p098, p099, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111;
45      byte p112, p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123, p124, p125, p126, p127;
46      byte p128, p129, p130, p131, p132, p133, p134, p135, p136, p137, p138, p139, p140, p141, p142, p143;
47      byte p144, p145, p146, p147, p148, p149, p150, p151, p152, p153, p154, p155, p156, p157, p158, p159;
48      byte p160, p161, p162, p163, p164, p165, p166, p167, p168, p169, p170, p171, p172, p173, p174, p175;
49      byte p176, p177, p178, p179, p180, p181, p182, p183, p184, p185, p186, p187, p188, p189, p190, p191;
50      byte p192, p193, p194, p195, p196, p197, p198, p199, p200, p201, p202, p203, p204, p205, p206, p207;
51      byte p208, p209, p210, p211, p212, p213, p214, p215, p216, p217, p218, p219, p220, p221, p222, p223;
52      byte p224, p225, p226, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239;
53      byte p240, p241, p242, p243, p244, p245, p246, p247, p248, p249, p250, p251, p252, p253, p254, p255;
54      int startRndMask;
55      BenchmarkParams benchmarkParams;
56      IterationParams iterationParams;
57      ThreadParams threadParams;
58      Blackhole blackhole;
59      Control notifyControl;
60  
61      public BenchmarkTaskResult testStringRelease_2_8_0_Throughput(InfraControl control, ThreadParams threadParams) throws Throwable {
62          this.benchmarkParams = control.benchmarkParams;
63          this.iterationParams = control.iterationParams;
64          this.threadParams    = threadParams;
65          this.notifyControl   = control.notifyControl;
66          if (this.blackhole == null) {
67              this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
68          }
69          if (threadParams.getSubgroupIndex() == 0) {
70              RawResults res = new RawResults();
71              IOUtilsContentEqualsInputStreamsBenchmark_jmhType l_ioutilscontentequalsinputstreamsbenchmark0_0 = _jmh_tryInit_f_ioutilscontentequalsinputstreamsbenchmark0_0(control);
72  
73              control.preSetup();
74  
75  
76              control.announceWarmupReady();
77              while (control.warmupShouldWait) {
78                  l_ioutilscontentequalsinputstreamsbenchmark0_0.testStringRelease_2_8_0(blackhole);
79                  if (control.shouldYield) Thread.yield();
80                  res.allOps++;
81              }
82  
83              notifyControl.startMeasurement = true;
84              testStringRelease_2_8_0_thrpt_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, l_ioutilscontentequalsinputstreamsbenchmark0_0);
85              notifyControl.stopMeasurement = true;
86              control.announceWarmdownReady();
87              try {
88                  while (control.warmdownShouldWait) {
89                      l_ioutilscontentequalsinputstreamsbenchmark0_0.testStringRelease_2_8_0(blackhole);
90                      if (control.shouldYield) Thread.yield();
91                      res.allOps++;
92                  }
93              } catch (Throwable e) {
94                  if (!(e instanceof InterruptedException)) throw e;
95              }
96              control.preTearDown();
97  
98              if (control.isLastIteration()) {
99                  f_ioutilscontentequalsinputstreamsbenchmark0_0 = null;
100             }
101             res.allOps += res.measuredOps;
102             int batchSize = iterationParams.getBatchSize();
103             int opsPerInv = benchmarkParams.getOpsPerInvocation();
104             res.allOps *= opsPerInv;
105             res.allOps /= batchSize;
106             res.measuredOps *= opsPerInv;
107             res.measuredOps /= batchSize;
108             BenchmarkTaskResult results = new BenchmarkTaskResult((long)res.allOps, (long)res.measuredOps);
109             results.add(new ThroughputResult(ResultRole.PRIMARY, "testStringRelease_2_8_0", res.measuredOps, res.getTime(), benchmarkParams.getTimeUnit()));
110             this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
111             return results;
112         } else
113             throw new IllegalStateException("Harness failed to distribute threads among groups properly");
114     }
115 
116     public static void testStringRelease_2_8_0_thrpt_jmhStub(InfraControl control, RawResults result, BenchmarkParams benchmarkParams, IterationParams iterationParams, ThreadParams threadParams, Blackhole blackhole, Control notifyControl, int startRndMask, IOUtilsContentEqualsInputStreamsBenchmark_jmhType l_ioutilscontentequalsinputstreamsbenchmark0_0) throws Throwable {
117         long operations = 0;
118         long realTime = 0;
119         result.startTime = System.nanoTime();
120         do {
121             l_ioutilscontentequalsinputstreamsbenchmark0_0.testStringRelease_2_8_0(blackhole);
122             operations++;
123         } while(!control.isDone);
124         result.stopTime = System.nanoTime();
125         result.realTime = realTime;
126         result.measuredOps = operations;
127     }
128 
129 
130     public BenchmarkTaskResult testStringRelease_2_8_0_AverageTime(InfraControl control, ThreadParams threadParams) throws Throwable {
131         this.benchmarkParams = control.benchmarkParams;
132         this.iterationParams = control.iterationParams;
133         this.threadParams    = threadParams;
134         this.notifyControl   = control.notifyControl;
135         if (this.blackhole == null) {
136             this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
137         }
138         if (threadParams.getSubgroupIndex() == 0) {
139             RawResults res = new RawResults();
140             IOUtilsContentEqualsInputStreamsBenchmark_jmhType l_ioutilscontentequalsinputstreamsbenchmark0_0 = _jmh_tryInit_f_ioutilscontentequalsinputstreamsbenchmark0_0(control);
141 
142             control.preSetup();
143 
144 
145             control.announceWarmupReady();
146             while (control.warmupShouldWait) {
147                 l_ioutilscontentequalsinputstreamsbenchmark0_0.testStringRelease_2_8_0(blackhole);
148                 if (control.shouldYield) Thread.yield();
149                 res.allOps++;
150             }
151 
152             notifyControl.startMeasurement = true;
153             testStringRelease_2_8_0_avgt_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, l_ioutilscontentequalsinputstreamsbenchmark0_0);
154             notifyControl.stopMeasurement = true;
155             control.announceWarmdownReady();
156             try {
157                 while (control.warmdownShouldWait) {
158                     l_ioutilscontentequalsinputstreamsbenchmark0_0.testStringRelease_2_8_0(blackhole);
159                     if (control.shouldYield) Thread.yield();
160                     res.allOps++;
161                 }
162             } catch (Throwable e) {
163                 if (!(e instanceof InterruptedException)) throw e;
164             }
165             control.preTearDown();
166 
167             if (control.isLastIteration()) {
168                 f_ioutilscontentequalsinputstreamsbenchmark0_0 = null;
169             }
170             res.allOps += res.measuredOps;
171             int batchSize = iterationParams.getBatchSize();
172             int opsPerInv = benchmarkParams.getOpsPerInvocation();
173             res.allOps *= opsPerInv;
174             res.allOps /= batchSize;
175             res.measuredOps *= opsPerInv;
176             res.measuredOps /= batchSize;
177             BenchmarkTaskResult results = new BenchmarkTaskResult((long)res.allOps, (long)res.measuredOps);
178             results.add(new AverageTimeResult(ResultRole.PRIMARY, "testStringRelease_2_8_0", res.measuredOps, res.getTime(), benchmarkParams.getTimeUnit()));
179             this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
180             return results;
181         } else
182             throw new IllegalStateException("Harness failed to distribute threads among groups properly");
183     }
184 
185     public static void testStringRelease_2_8_0_avgt_jmhStub(InfraControl control, RawResults result, BenchmarkParams benchmarkParams, IterationParams iterationParams, ThreadParams threadParams, Blackhole blackhole, Control notifyControl, int startRndMask, IOUtilsContentEqualsInputStreamsBenchmark_jmhType l_ioutilscontentequalsinputstreamsbenchmark0_0) throws Throwable {
186         long operations = 0;
187         long realTime = 0;
188         result.startTime = System.nanoTime();
189         do {
190             l_ioutilscontentequalsinputstreamsbenchmark0_0.testStringRelease_2_8_0(blackhole);
191             operations++;
192         } while(!control.isDone);
193         result.stopTime = System.nanoTime();
194         result.realTime = realTime;
195         result.measuredOps = operations;
196     }
197 
198 
199     public BenchmarkTaskResult testStringRelease_2_8_0_SampleTime(InfraControl control, ThreadParams threadParams) throws Throwable {
200         this.benchmarkParams = control.benchmarkParams;
201         this.iterationParams = control.iterationParams;
202         this.threadParams    = threadParams;
203         this.notifyControl   = control.notifyControl;
204         if (this.blackhole == null) {
205             this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
206         }
207         if (threadParams.getSubgroupIndex() == 0) {
208             RawResults res = new RawResults();
209             IOUtilsContentEqualsInputStreamsBenchmark_jmhType l_ioutilscontentequalsinputstreamsbenchmark0_0 = _jmh_tryInit_f_ioutilscontentequalsinputstreamsbenchmark0_0(control);
210 
211             control.preSetup();
212 
213 
214             control.announceWarmupReady();
215             while (control.warmupShouldWait) {
216                 l_ioutilscontentequalsinputstreamsbenchmark0_0.testStringRelease_2_8_0(blackhole);
217                 if (control.shouldYield) Thread.yield();
218                 res.allOps++;
219             }
220 
221             notifyControl.startMeasurement = true;
222             int targetSamples = (int) (control.getDuration(TimeUnit.MILLISECONDS) * 20); // at max, 20 timestamps per millisecond
223             int batchSize = iterationParams.getBatchSize();
224             int opsPerInv = benchmarkParams.getOpsPerInvocation();
225             SampleBuffer buffer = new SampleBuffer();
226             testStringRelease_2_8_0_sample_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, buffer, targetSamples, opsPerInv, batchSize, l_ioutilscontentequalsinputstreamsbenchmark0_0);
227             notifyControl.stopMeasurement = true;
228             control.announceWarmdownReady();
229             try {
230                 while (control.warmdownShouldWait) {
231                     l_ioutilscontentequalsinputstreamsbenchmark0_0.testStringRelease_2_8_0(blackhole);
232                     if (control.shouldYield) Thread.yield();
233                     res.allOps++;
234                 }
235             } catch (Throwable e) {
236                 if (!(e instanceof InterruptedException)) throw e;
237             }
238             control.preTearDown();
239 
240             if (control.isLastIteration()) {
241                 f_ioutilscontentequalsinputstreamsbenchmark0_0 = null;
242             }
243             res.allOps += res.measuredOps * batchSize;
244             res.allOps *= opsPerInv;
245             res.allOps /= batchSize;
246             res.measuredOps *= opsPerInv;
247             BenchmarkTaskResult results = new BenchmarkTaskResult((long)res.allOps, (long)res.measuredOps);
248             results.add(new SampleTimeResult(ResultRole.PRIMARY, "testStringRelease_2_8_0", buffer, benchmarkParams.getTimeUnit()));
249             this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
250             return results;
251         } else
252             throw new IllegalStateException("Harness failed to distribute threads among groups properly");
253     }
254 
255     public static void testStringRelease_2_8_0_sample_jmhStub(InfraControl control, RawResults result, BenchmarkParams benchmarkParams, IterationParams iterationParams, ThreadParams threadParams, Blackhole blackhole, Control notifyControl, int startRndMask, SampleBuffer buffer, int targetSamples, long opsPerInv, int batchSize, IOUtilsContentEqualsInputStreamsBenchmark_jmhType l_ioutilscontentequalsinputstreamsbenchmark0_0) throws Throwable {
256         long realTime = 0;
257         long operations = 0;
258         int rnd = (int)System.nanoTime();
259         int rndMask = startRndMask;
260         long time = 0;
261         int currentStride = 0;
262         do {
263             rnd = (rnd * 1664525 + 1013904223);
264             boolean sample = (rnd & rndMask) == 0;
265             if (sample) {
266                 time = System.nanoTime();
267             }
268             for (int b = 0; b < batchSize; b++) {
269                 if (control.volatileSpoiler) return;
270                 l_ioutilscontentequalsinputstreamsbenchmark0_0.testStringRelease_2_8_0(blackhole);
271             }
272             if (sample) {
273                 buffer.add((System.nanoTime() - time) / opsPerInv);
274                 if (currentStride++ > targetSamples) {
275                     buffer.half();
276                     currentStride = 0;
277                     rndMask = (rndMask << 1) + 1;
278                 }
279             }
280             operations++;
281         } while(!control.isDone);
282         startRndMask = Math.max(startRndMask, rndMask);
283         result.realTime = realTime;
284         result.measuredOps = operations;
285     }
286 
287 
288     public BenchmarkTaskResult testStringRelease_2_8_0_SingleShotTime(InfraControl control, ThreadParams threadParams) throws Throwable {
289         this.benchmarkParams = control.benchmarkParams;
290         this.iterationParams = control.iterationParams;
291         this.threadParams    = threadParams;
292         this.notifyControl   = control.notifyControl;
293         if (this.blackhole == null) {
294             this.blackhole = new Blackhole("Today's password is swordfish. I understand instantiating Blackholes directly is dangerous.");
295         }
296         if (threadParams.getSubgroupIndex() == 0) {
297             IOUtilsContentEqualsInputStreamsBenchmark_jmhType l_ioutilscontentequalsinputstreamsbenchmark0_0 = _jmh_tryInit_f_ioutilscontentequalsinputstreamsbenchmark0_0(control);
298 
299             control.preSetup();
300 
301 
302             notifyControl.startMeasurement = true;
303             RawResults res = new RawResults();
304             int batchSize = iterationParams.getBatchSize();
305             testStringRelease_2_8_0_ss_jmhStub(control, res, benchmarkParams, iterationParams, threadParams, blackhole, notifyControl, startRndMask, batchSize, l_ioutilscontentequalsinputstreamsbenchmark0_0);
306             control.preTearDown();
307 
308             if (control.isLastIteration()) {
309                 f_ioutilscontentequalsinputstreamsbenchmark0_0 = null;
310             }
311             int opsPerInv = control.benchmarkParams.getOpsPerInvocation();
312             long totalOps = opsPerInv;
313             BenchmarkTaskResult results = new BenchmarkTaskResult(totalOps, totalOps);
314             results.add(new SingleShotResult(ResultRole.PRIMARY, "testStringRelease_2_8_0", res.getTime(), totalOps, benchmarkParams.getTimeUnit()));
315             this.blackhole.evaporate("Yes, I am Stephen Hawking, and know a thing or two about black holes.");
316             return results;
317         } else
318             throw new IllegalStateException("Harness failed to distribute threads among groups properly");
319     }
320 
321     public static void testStringRelease_2_8_0_ss_jmhStub(InfraControl control, RawResults result, BenchmarkParams benchmarkParams, IterationParams iterationParams, ThreadParams threadParams, Blackhole blackhole, Control notifyControl, int startRndMask, int batchSize, IOUtilsContentEqualsInputStreamsBenchmark_jmhType l_ioutilscontentequalsinputstreamsbenchmark0_0) throws Throwable {
322         long realTime = 0;
323         result.startTime = System.nanoTime();
324         for (int b = 0; b < batchSize; b++) {
325             if (control.volatileSpoiler) return;
326             l_ioutilscontentequalsinputstreamsbenchmark0_0.testStringRelease_2_8_0(blackhole);
327         }
328         result.stopTime = System.nanoTime();
329         result.realTime = realTime;
330     }
331 
332     
333     IOUtilsContentEqualsInputStreamsBenchmark_jmhType f_ioutilscontentequalsinputstreamsbenchmark0_0;
334     
335     IOUtilsContentEqualsInputStreamsBenchmark_jmhType _jmh_tryInit_f_ioutilscontentequalsinputstreamsbenchmark0_0(InfraControl control) throws Throwable {
336         if (control.isFailing) throw new FailureAssistException();
337         IOUtilsContentEqualsInputStreamsBenchmark_jmhType val = f_ioutilscontentequalsinputstreamsbenchmark0_0;
338         if (val == null) {
339             val = new IOUtilsContentEqualsInputStreamsBenchmark_jmhType();
340             f_ioutilscontentequalsinputstreamsbenchmark0_0 = val;
341         }
342         return val;
343     }
344 
345 
346 }
347