summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorhansson <hansson@google.com>2018-02-16 11:19:37 +0000
committerandroid-build-merger <android-build-merger@google.com>2018-02-16 11:19:37 +0000
commit74892bed529d5754d5ccd5e1e5f8dd84872f44f2 (patch)
tree9c6e107b574cfaa3a54be7ab237062e3eb4217d4 /benchmarks
parent6e822f05f14c80ac5146223832c2da39ed9f9d24 (diff)
parent85d0d70f9d906f6e8bb61b2f1d2f1ebd6c0f47d9 (diff)
Merge "Remove cachedLocaleData from NumberFormat." am: 6f5d9c76f5 am: 7ee10b4533
am: 85d0d70f9d Change-Id: If56380c0b5ba1cd50da96f1151c09fd25301cfbb
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/src/benchmarks/regression/NumberFormatBenchmark.java31
1 files changed, 31 insertions, 0 deletions
diff --git a/benchmarks/src/benchmarks/regression/NumberFormatBenchmark.java b/benchmarks/src/benchmarks/regression/NumberFormatBenchmark.java
new file mode 100644
index 0000000000..4e1f43358e
--- /dev/null
+++ b/benchmarks/src/benchmarks/regression/NumberFormatBenchmark.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package benchmarks.regression;
+
+import java.text.NumberFormat;
+import java.util.Locale;
+
+public class NumberFormatBenchmark {
+
+ private static Locale locale = Locale.getDefault(Locale.Category.FORMAT);
+
+ public void time_instantiation(int reps) {
+ for (int i = 0; i < reps; i++) {
+ NumberFormat.getInstance(locale);
+ }
+ }
+}