File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
Samples/SwiftKitSampleApp/src/jmh/java/org/swift/swiftkit Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -36,19 +36,15 @@ public static class BenchmarkState {
3636 MySwiftClass obj ;
3737
3838 @ Setup (Level .Trial )
39- public void beforeALl () {
40- System .loadLibrary ("swiftCore" );
41- System .loadLibrary ("ExampleSwiftLibrary" );
42-
43- // Tune down debug statements so they don't fill up stdout
44- System .setProperty ("jextract.trace.downcalls" , "false" );
45-
39+ public void beforeAll () {
4640 obj = new MySwiftClass (1 , 2 );
4741 }
4842 }
4943
50- @ Benchmark @ BenchmarkMode (Mode .AverageTime ) @ OutputTimeUnit (TimeUnit .NANOSECONDS )
51- public void simpleSwiftApiCall (BenchmarkState state , Blackhole blackhole ) {
52- blackhole .consume (state .obj .makeRandomIntMethod ());
44+ @ Benchmark
45+ @ BenchmarkMode (Mode .AverageTime )
46+ @ OutputTimeUnit (TimeUnit .NANOSECONDS )
47+ public long simpleSwiftApiCall (BenchmarkState state , Blackhole blackhole ) {
48+ return state .obj .makeRandomIntMethod ();
5349 }
5450}
You can’t perform that action at this time.
0 commit comments