diff options
author | Igor Murashkin <iam@google.com> | 2016-09-26 18:04:28 +0000 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2016-09-26 18:04:47 +0000 |
commit | bb8ae11060702085987c459623c96c1af60a2aa0 (patch) | |
tree | e0550971f0e7755a9a7f0bb492fc86fb446b091e /benchmarks | |
parent | 29c483ff48aca9e1949e343558522738faec37d6 (diff) |
Revert "Revert "benchmarks: Add timings for @FastNative/@CriticalNative""
This reverts commit 29c483ff48aca9e1949e343558522738faec37d6.
Change-Id: If76b87b14751ccb2a804182e12ea83efe4a3d00e
Diffstat (limited to 'benchmarks')
-rw-r--r-- | benchmarks/src/benchmarks/regression/NativeMethodBenchmark.java | 77 |
1 files changed, 66 insertions, 11 deletions
diff --git a/benchmarks/src/benchmarks/regression/NativeMethodBenchmark.java b/benchmarks/src/benchmarks/regression/NativeMethodBenchmark.java index c30ea08333..dbb630829c 100644 --- a/benchmarks/src/benchmarks/regression/NativeMethodBenchmark.java +++ b/benchmarks/src/benchmarks/regression/NativeMethodBenchmark.java @@ -32,16 +32,38 @@ public class NativeMethodBenchmark { } } - public void time_emptyJniStaticMethod0(int reps) throws Exception { + + public void time_emptyJniMethod0(int reps) throws Exception { + NativeTestTarget n = new NativeTestTarget(); for (int i = 0; i < reps; ++i) { - NativeTestTarget.emptyJniStaticMethod0(); + n.emptyJniMethod0(); } } - public void time_emptyJniMethod0(int reps) throws Exception { + public void time_emptyJniMethod6(int reps) throws Exception { + int a = -1; + int b = 0; NativeTestTarget n = new NativeTestTarget(); for (int i = 0; i < reps; ++i) { - n.emptyJniMethod0(); + n.emptyJniMethod6(a, b, 1, 2, 3, i); + } + } + + public void time_emptyJniMethod6L(int reps) throws Exception { + NativeTestTarget n = new NativeTestTarget(); + for (int i = 0; i < reps; ++i) { + n.emptyJniMethod6L(null, null, null, null, null, null); + } + } + + public void time_emptyJniStaticMethod6L(int reps) throws Exception { + for (int i = 0; i < reps; ++i) { + NativeTestTarget.emptyJniStaticMethod6L(null, null, null, null, null, null); + } + } + public void time_emptyJniStaticMethod0(int reps) throws Exception { + for (int i = 0; i < reps; ++i) { + NativeTestTarget.emptyJniStaticMethod0(); } } @@ -53,26 +75,59 @@ public class NativeMethodBenchmark { } } - public void time_emptyJniMethod6(int reps) throws Exception { + public void time_emptyJniMethod0_Fast(int reps) throws Exception { + NativeTestTarget n = new NativeTestTarget(); + for (int i = 0; i < reps; ++i) { + n.emptyJniMethod0_Fast(); + } + } + + public void time_emptyJniMethod6_Fast(int reps) throws Exception { int a = -1; int b = 0; NativeTestTarget n = new NativeTestTarget(); for (int i = 0; i < reps; ++i) { - n.emptyJniMethod6(a, b, 1, 2, 3, i); + n.emptyJniMethod6_Fast(a, b, 1, 2, 3, i); } } - public void time_emptyJniStaticMethod6L(int reps) throws Exception { + public void time_emptyJniMethod6L_Fast(int reps) throws Exception { + NativeTestTarget n = new NativeTestTarget(); for (int i = 0; i < reps; ++i) { - NativeTestTarget.emptyJniStaticMethod6L(null, null, null, null, null, null); + n.emptyJniMethod6L_Fast(null, null, null, null, null, null); } } - public void time_emptyJniMethod6L(int reps) throws Exception { - NativeTestTarget n = new NativeTestTarget(); + public void time_emptyJniStaticMethod6L_Fast(int reps) throws Exception { for (int i = 0; i < reps; ++i) { - n.emptyJniMethod6L(null, null, null, null, null, null); + NativeTestTarget.emptyJniStaticMethod6L_Fast(null, null, null, null, null, null); + } + } + public void time_emptyJniStaticMethod0_Fast(int reps) throws Exception { + for (int i = 0; i < reps; ++i) { + NativeTestTarget.emptyJniStaticMethod0_Fast(); } } + public void time_emptyJniStaticMethod6_Fast(int reps) throws Exception { + int a = -1; + int b = 0; + for (int i = 0; i < reps; ++i) { + NativeTestTarget.emptyJniStaticMethod6_Fast(a, b, 1, 2, 3, i); + } + } + + public void time_emptyJniStaticMethod0_Critical(int reps) throws Exception { + for (int i = 0; i < reps; ++i) { + NativeTestTarget.emptyJniStaticMethod0_Critical(); + } + } + + public void time_emptyJniStaticMethod6_Critical(int reps) throws Exception { + int a = -1; + int b = 0; + for (int i = 0; i < reps; ++i) { + NativeTestTarget.emptyJniStaticMethod6_Critical(a, b, 1, 2, 3, i); + } + } } |