diff options
author | Igor Murashkin <iam@google.com> | 2016-09-15 14:58:24 -0700 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2016-09-23 14:52:57 -0700 |
commit | efab71a017c44850bda9719567683b8c0b3a6f60 (patch) | |
tree | a283a6518c15e383ddbbb899e816d3d16fa75a0a /benchmarks | |
parent | 3407235b8e113ae1c5168dc49c4e7f3fb56ed1c9 (diff) |
benchmarks: Add timings for @FastNative/@CriticalNative
Bug: 31399521
Bug: 31712552
Test: vogar --benchmark libcore/benchmarks/src/benchmarks/regression/NativeMethodBenchmark.java
Change-Id: I704686c97946907b914ad7e44882e4ddbd94a4ff
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); + } + } } |