File tree Expand file tree Collapse file tree 12 files changed +19
-23
lines changed 
main/android/uk/co/real_logic/sbe/codec/java Expand file tree Collapse file tree 12 files changed +19
-23
lines changed Original file line number Diff line number Diff line change @@ -78,8 +78,8 @@ public Constructor<?> run() throws Exception
7878 if  (Modifier .isAbstract (clazz .getModifiers ()))
7979 {
8080 //use this starting with api level < 18 
81-  clazz  = Class .forName ("java.nio.ReadWriteDirectByteBuffer" );
82-  constructor  = clazz .getDeclaredConstructor (int .class , int .class );
81+  final   Class <?>  rwClazz  = Class .forName ("java.nio.ReadWriteDirectByteBuffer" );
82+  constructor  = rwClazz .getDeclaredConstructor (int .class , int .class );
8383 }
8484 else 
8585 {
Original file line number Diff line number Diff line change 7878 </javac >
7979
8080 <jar  destfile =" ${dir.target.perf.dist}/microbenchmarks.jar"  >
81-  <manifest >
82-  <attribute  name =" Main-Class"   value =" org.openjdk.jmh.Main"  />
83-  </manifest >
8481 <fileset  dir =" ${dir.target.perf.classes}"   includes =" **/*"  />
85-  <zipgroupfileset  dir =" target/dist"   includes =" **/sbe.jar"  />
86-  <zipgroupfileset  dir =" perf/lib"   includes =" **/*.jar"  />
8782 </jar >
8883 </target >
8984
9085 <target  name =" java:perf:test"   depends =" java:compile"  >
91-  <exec   executable = " java "   failonerror =" true"  >
92-  <arg   value = " -jar "  />
93-  <arg   value = " target/ perf/ dist/microbenchmarks.jar"  />
86+  <java   classname = " org.openjdk.jmh.Main "   failonerror = " true "   fork =" true"  >
87+  <classpath   refid = " perf.tools.classpath "  />
88+  <classpath   path = " ${dir. target. perf. dist} /microbenchmarks.jar"  />
9489 <arg  value =" -wi"  />
9590 <arg  value =" 3"  />
9691 <arg  value =" -i"  />
9792 <arg  value =" 3"  />
9893 <arg  value =" .*Benchmark.*"  />
99-  </exec >
94+  </java >
10095 </target >
10196
10297 <target  name =" cpp:codegen"   depends =" init"  >
Original file line number Diff line number Diff line change 1616
1717package  uk .co .real_logic .protobuf ;
1818
19- import  org .openjdk .jmh .annotations .GenerateMicroBenchmark ;
19+ import  org .openjdk .jmh .annotations .Benchmark ;
2020import  org .openjdk .jmh .annotations .Scope ;
2121import  org .openjdk .jmh .annotations .State ;
2222import  uk .co .real_logic .protobuf .examples .Examples ;
@@ -47,13 +47,13 @@ public static class MyState
4747 }
4848 }
4949
50-  @ GenerateMicroBenchmark 
50+  @ Benchmark 
5151 public  byte [] testEncode (final  MyState  state ) throws  Exception 
5252 {
5353 return  encode ();
5454 }
5555
56-  @ GenerateMicroBenchmark 
56+  @ Benchmark 
5757 public  Examples .Car  testDecode (final  MyState  state ) throws  Exception 
5858 {
5959 final  byte [] buffer  = state .decodeBuffer ;
Original file line number Diff line number Diff line change 1515 */ 
1616package  uk .co .real_logic .protobuf ;
1717
18- import  org .openjdk .jmh .annotations .GenerateMicroBenchmark ;
18+ import  org .openjdk .jmh .annotations .Benchmark ;
1919import  org .openjdk .jmh .annotations .Scope ;
2020import  org .openjdk .jmh .annotations .State ;
21+ 
2122import  uk .co .real_logic .protobuf .fix .Fix ;
2223
2324public  class  MarketDataBenchmark 
@@ -39,13 +40,13 @@ public static class MyState
3940 }
4041 }
4142
42-  @ GenerateMicroBenchmark 
43+  @ Benchmark 
4344 public  byte [] testEncode (final  MyState  state ) throws  Exception 
4445 {
4546 return  encode ();
4647 }
4748
48-  @ GenerateMicroBenchmark 
49+  @ Benchmark 
4950 public  Fix .MarketDataIncrementalRefreshTrades  testDecode (final  MyState  state ) throws  Exception 
5051 {
5152 final  byte [] buffer  = state .decodeBuffer ;
Original file line number Diff line number Diff line change 1616
1717package  uk .co .real_logic .sbe ;
1818
19- import  org .openjdk .jmh .annotations .GenerateMicroBenchmark ;
19+ import  org .openjdk .jmh .annotations .Benchmark ;
2020import  org .openjdk .jmh .annotations .Scope ;
2121import  org .openjdk .jmh .annotations .State ;
2222import  uk .co .real_logic .sbe .examples .*;
@@ -63,7 +63,7 @@ public static class MyState
6363 }
6464 }
6565
66-  @ GenerateMicroBenchmark 
66+  @ Benchmark 
6767 public  int  testEncode (final  MyState  state )
6868 {
6969 final  Car  car  = state .car ;
@@ -76,7 +76,7 @@ public int testEncode(final MyState state)
7676 return  car .size ();
7777 }
7878
79-  @ GenerateMicroBenchmark 
79+  @ Benchmark 
8080 public  int  testDecode (final  MyState  state )
8181 {
8282 final  Car  car  = state .car ;
Original file line number Diff line number Diff line change 1515 */ 
1616package  uk .co .real_logic .sbe ;
1717
18- import  org .openjdk .jmh .annotations .GenerateMicroBenchmark ;
18+ import  org .openjdk .jmh .annotations .Benchmark ;
1919import  org .openjdk .jmh .annotations .Scope ;
2020import  org .openjdk .jmh .annotations .State ;
2121import  uk .co .real_logic .sbe .codec .java .DirectBuffer ;
@@ -40,7 +40,7 @@ public static class MyState
4040 }
4141 }
4242
43-  @ GenerateMicroBenchmark 
43+  @ Benchmark 
4444 public  int  testEncode (final  MyState  state )
4545 {
4646 final  MarketDataIncrementalRefreshTrades  marketData  = state .marketData ;
@@ -53,7 +53,7 @@ public int testEncode(final MyState state)
5353 return  marketData .size ();
5454 }
5555
56-  @ GenerateMicroBenchmark 
56+  @ Benchmark 
5757 public  int  testDecode (final  MyState  state )
5858 {
5959 final  MarketDataIncrementalRefreshTrades  marketData  = state .marketData ;
                                 You can’t perform that action at this time. 
               
                  
0 commit comments