summaryrefslogtreecommitdiffstats
path: root/benchmarks
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-04-24 17:05:16 -0700
committerMathieu Chartier <mathieuc@google.com>2015-04-24 19:43:15 -0700
commit2abeaa62bbba16960e3d824745b77705478f8450 (patch)
tree65aa92fe83118ea1482d69bcbf5cdac7d2054bbe /benchmarks
parentdce989e53c440c7bb0eec93abf20a71bf1f49b1c (diff)
downloadlibcore-2abeaa62bbba16960e3d824745b77705478f8450.tar.gz
libcore-2abeaa62bbba16960e3d824745b77705478f8450.tar.bz2
libcore-2abeaa62bbba16960e3d824745b77705478f8450.zip
Move Class.newInstance to native
Also add benchmark for Class.newInstance. Bug: 20269715 Change-Id: Icd52155ce79a978a4d869855bfdfd7735abd8187
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/src/benchmarks/regression/ReflectionBenchmark.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/benchmarks/src/benchmarks/regression/ReflectionBenchmark.java b/benchmarks/src/benchmarks/regression/ReflectionBenchmark.java
index f8f3c93d3..fcb26364b 100644
--- a/benchmarks/src/benchmarks/regression/ReflectionBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/ReflectionBenchmark.java
@@ -156,6 +156,13 @@ public class ReflectionBenchmark extends SimpleBenchmark {
}
}
+ public void timeClass_classNewInstance(int reps) throws Exception {
+ Class<?> klass = C.class;
+ for (int rep = 0; rep < reps; ++rep) {
+ klass.newInstance();
+ }
+ }
+
public void timeGetInstanceField(int reps) throws Exception {
for (int rep = 0; rep < reps; ++rep) {
// The field here (and in timeGetStaticField) were chosen to be