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 {
36
36
MySwiftClass obj ;
37
37
38
38
@ 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 () {
46
40
obj = new MySwiftClass (1 , 2 );
47
41
}
48
42
}
49
43
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 ();
53
49
}
54
50
}
You can’t perform that action at this time.
0 commit comments