Diff
Modified: trunk/PerformanceTests/ChangeLog (216213 => 216214)
--- trunk/PerformanceTests/ChangeLog 2017-05-04 22:35:31 UTC (rev 216213)
+++ trunk/PerformanceTests/ChangeLog 2017-05-04 23:03:52 UTC (rev 216214)
@@ -1,3 +1,23 @@
+2017-05-04 Andy VanWagoner <thetalecraf...@gmail.com>
+
+ [INTL] Add PerformanceTests for Intl objects
+ https://bugs.webkit.org/show_bug.cgi?id=171695
+
+ Reviewed by Benjamin Poulain.
+
+ * Intl/collator-compare-all-options.html: Added.
+ * Intl/collator-compare-default.html: Added.
+ * Intl/collator-create-all-options.html: Added.
+ * Intl/collator-create-default.html: Added.
+ * Intl/datetimeformat-create-all-options.html: Added.
+ * Intl/datetimeformat-create-default.html: Added.
+ * Intl/datetimeformat-format-all-options.html: Added.
+ * Intl/datetimeformat-format-default.html: Added.
+ * Intl/numberformat-create-all-options.html: Added.
+ * Intl/numberformat-create-default.html: Added.
+ * Intl/numberformat-format-all-options.html: Added.
+ * Intl/numberformat-format-default.html: Added.
+
2017-04-27 Michael Saboff <msab...@apple.com>
Add back tests inadvertently deleted in r205032.
Added: trunk/PerformanceTests/Intl/collator-compare-all-options.html (0 => 216214)
--- trunk/PerformanceTests/Intl/collator-compare-all-options.html (rev 0)
+++ trunk/PerformanceTests/Intl/collator-compare-all-options.html 2017-05-04 23:03:52 UTC (rev 216214)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+var count = 0;
+var collator = new Intl.Collator('en-US-u-co-dict-kn-false-kf-upper', {
+ localeMatcher: 'best fit',
+ usage: 'sort',
+ sensitivity: 'variant',
+ ignorePunctuation: true,
+ numeric: true,
+ caseFirst: false
+});
+var array = [];
+for (var i = 0; i < 100; i++) {
+ array[i] = i.toString(36).repeat(i)
+}
+
+PerfTestRunner.measureRunsPerSecond({run() {
+ array.slice().sort(collator.compare);
+ count++;
+}});
+</script>
+</body>
\ No newline at end of file
Added: trunk/PerformanceTests/Intl/collator-compare-default.html (0 => 216214)
--- trunk/PerformanceTests/Intl/collator-compare-default.html (rev 0)
+++ trunk/PerformanceTests/Intl/collator-compare-default.html 2017-05-04 23:03:52 UTC (rev 216214)
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+var count = 0;
+var collator = new Intl.Collator();
+var array = [];
+for (var i = 0; i < 100; i++) {
+ array[i] = i.toString(36).repeat(i)
+}
+
+PerfTestRunner.measureRunsPerSecond({run() {
+ array.slice().sort(collator.compare);
+ count++;
+}});
+</script>
+</body>
\ No newline at end of file
Added: trunk/PerformanceTests/Intl/collator-create-all-options.html (0 => 216214)
--- trunk/PerformanceTests/Intl/collator-create-all-options.html (rev 0)
+++ trunk/PerformanceTests/Intl/collator-create-all-options.html 2017-05-04 23:03:52 UTC (rev 216214)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+var count = 0;
+PerfTestRunner.measureRunsPerSecond({run() {
+ new Intl.Collator('en-US-u-co-dict-kn-false-kf-upper', {
+ localeMatcher: 'best fit',
+ usage: count % 2 ? 'sort' : 'search',
+ sensitivity: 'variant',
+ ignorePunctuation: true,
+ numeric: true,
+ caseFirst: false
+ });
+ count++;
+}});
+</script>
+</body>
\ No newline at end of file
Added: trunk/PerformanceTests/Intl/collator-create-default.html (0 => 216214)
--- trunk/PerformanceTests/Intl/collator-create-default.html (rev 0)
+++ trunk/PerformanceTests/Intl/collator-create-default.html 2017-05-04 23:03:52 UTC (rev 216214)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+var count = 0;
+PerfTestRunner.measureRunsPerSecond({run() {
+ new Intl.Collator();
+ count++;
+}});
+</script>
+</body>
\ No newline at end of file
Added: trunk/PerformanceTests/Intl/datetimeformat-create-all-options.html (0 => 216214)
--- trunk/PerformanceTests/Intl/datetimeformat-create-all-options.html (rev 0)
+++ trunk/PerformanceTests/Intl/datetimeformat-create-all-options.html 2017-05-04 23:03:52 UTC (rev 216214)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+var count = 0;
+PerfTestRunner.measureRunsPerSecond({run() {
+ new Intl.DateTimeFormat('am-ET-u-nu-ethi-ca-ethiopic-amete-alem', {
+ localeMatcher: 'best fit',
+ timeZone: 'Africa/Addis_Ababa',
+ hour12: true,
+ formatMatcher: 'best fit',
+ weekday: 'long',
+ era: 'long',
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric',
+ hour: 'numeric',
+ minute: '2-digit',
+ second: '2-digit',
+ timeZoneName: 'long'
+ });
+ count++;
+}});
+</script>
+</body>
\ No newline at end of file
Added: trunk/PerformanceTests/Intl/datetimeformat-create-default.html (0 => 216214)
--- trunk/PerformanceTests/Intl/datetimeformat-create-default.html (rev 0)
+++ trunk/PerformanceTests/Intl/datetimeformat-create-default.html 2017-05-04 23:03:52 UTC (rev 216214)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+var count = 0;
+PerfTestRunner.measureRunsPerSecond({run() {
+ new Intl.DateTimeFormat();
+ count++;
+}});
+</script>
+</body>
\ No newline at end of file
Added: trunk/PerformanceTests/Intl/datetimeformat-format-all-options.html (0 => 216214)
--- trunk/PerformanceTests/Intl/datetimeformat-format-all-options.html (rev 0)
+++ trunk/PerformanceTests/Intl/datetimeformat-format-all-options.html 2017-05-04 23:03:52 UTC (rev 216214)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+var count = 0;
+var format = new Intl.DateTimeFormat('am-ET-u-nu-ethi-ca-ethiopic-amete-alem', {
+ localeMatcher: 'best fit',
+ timeZone: 'Africa/Addis_Ababa',
+ hour12: true,
+ formatMatcher: 'best fit',
+ weekday: 'long',
+ era: 'long',
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric',
+ hour: 'numeric',
+ minute: '2-digit',
+ second: '2-digit',
+ timeZoneName: 'long'
+});
+var DAY_IN_MS = 24 * 60 * 60 * 1000;
+
+PerfTestRunner.measureRunsPerSecond({run() {
+ format.format(count++ * DAY_IN_MS);
+}});
+</script>
+</body>
\ No newline at end of file
Added: trunk/PerformanceTests/Intl/datetimeformat-format-default.html (0 => 216214)
--- trunk/PerformanceTests/Intl/datetimeformat-format-default.html (rev 0)
+++ trunk/PerformanceTests/Intl/datetimeformat-format-default.html 2017-05-04 23:03:52 UTC (rev 216214)
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+var count = 0;
+var format = new Intl.DateTimeFormat();
+var DAY_IN_MS = 24 * 60 * 60 * 1000;
+
+PerfTestRunner.measureRunsPerSecond({run() {
+ format.format(count++ * DAY_IN_MS);
+}});
+</script>
+</body>
\ No newline at end of file
Added: trunk/PerformanceTests/Intl/numberformat-create-all-options.html (0 => 216214)
--- trunk/PerformanceTests/Intl/numberformat-create-all-options.html (rev 0)
+++ trunk/PerformanceTests/Intl/numberformat-create-all-options.html 2017-05-04 23:03:52 UTC (rev 216214)
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+var count = 0;
+PerfTestRunner.measureRunsPerSecond({run() {
+ new Intl.NumberFormat('en-AU-u-nu-fullwide', {
+ localeMatcher: 'best fit',
+ style: 'currency',
+ currency: 'AUD',
+ currencyDisplay: 'name',
+ useGrouping: 'false',
+ minimumIntegerDigits: 2,
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2,
+ minimumSignificantDigits: 3,
+ maximumSignificantDigits: 21
+ });
+ count++;
+}});
+</script>
+</body>
\ No newline at end of file
Added: trunk/PerformanceTests/Intl/numberformat-create-default.html (0 => 216214)
--- trunk/PerformanceTests/Intl/numberformat-create-default.html (rev 0)
+++ trunk/PerformanceTests/Intl/numberformat-create-default.html 2017-05-04 23:03:52 UTC (rev 216214)
@@ -0,0 +1,11 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+var count = 0;
+PerfTestRunner.measureRunsPerSecond({run() {
+ new Intl.NumberFormat();
+ count++;
+}});
+</script>
+</body>
\ No newline at end of file
Added: trunk/PerformanceTests/Intl/numberformat-format-all-options.html (0 => 216214)
--- trunk/PerformanceTests/Intl/numberformat-format-all-options.html (rev 0)
+++ trunk/PerformanceTests/Intl/numberformat-format-all-options.html 2017-05-04 23:03:52 UTC (rev 216214)
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+var count = 0;
+var format = new Intl.NumberFormat('en-AU-u-nu-fullwide', {
+ localeMatcher: 'best fit',
+ style: 'currency',
+ currency: 'AUD',
+ currencyDisplay: 'name',
+ useGrouping: 'false',
+ minimumIntegerDigits: 2,
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2
+ // The following options would override the above when formatting.
+ // minimumSignificantDigits: 3,
+ // maximumSignificantDigits: 21
+});
+
+PerfTestRunner.measureRunsPerSecond({run() {
+ format.format(count++);
+}});
+</script>
+</body>
\ No newline at end of file
Added: trunk/PerformanceTests/Intl/numberformat-format-default.html (0 => 216214)
--- trunk/PerformanceTests/Intl/numberformat-format-default.html (rev 0)
+++ trunk/PerformanceTests/Intl/numberformat-format-default.html 2017-05-04 23:03:52 UTC (rev 216214)
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<body>
+<script src=""
+<script>
+var count = 0;
+var format = new Intl.NumberFormat();
+
+PerfTestRunner.measureRunsPerSecond({run() {
+ format.format(count++);
+}});
+</script>
+</body>
\ No newline at end of file