diff options
author | Mathieu Chartier <mathieuc@google.com> | 2015-04-24 17:05:16 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2015-04-24 19:43:15 -0700 |
commit | 2abeaa62bbba16960e3d824745b77705478f8450 (patch) | |
tree | 65aa92fe83118ea1482d69bcbf5cdac7d2054bbe /benchmarks | |
parent | dce989e53c440c7bb0eec93abf20a71bf1f49b1c (diff) | |
download | libcore-2abeaa62bbba16960e3d824745b77705478f8450.zip libcore-2abeaa62bbba16960e3d824745b77705478f8450.tar.gz libcore-2abeaa62bbba16960e3d824745b77705478f8450.tar.bz2 |
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.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/benchmarks/src/benchmarks/regression/ReflectionBenchmark.java b/benchmarks/src/benchmarks/regression/ReflectionBenchmark.java index f8f3c93..fcb2636 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 |