diff --git a/test/js-perf-test/Intl/constructor.js b/test/js-perf-test/Intl/constructor.js new file mode 100644 index 0000000000..e5b3a86694 --- /dev/null +++ b/test/js-perf-test/Intl/constructor.js @@ -0,0 +1,32 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +function NewIntlCollator() { + let obj = new Intl.Collator(); +} +createSuite('NewIntlCollator', 100, NewIntlCollator, ()=>{}); + +function NewIntlDateTimeFormat() { + let obj = new Intl.DateTimeFormat(); +} +createSuite('NewIntlDateTimeFormat', 100, NewIntlDateTimeFormat, ()=>{}); + +function NewIntlNumberFormat() { + let obj = new Intl.NumberFormat(); +} +createSuite('NewIntlNumberFormat', 100, NewIntlNumberFormat, ()=>{}); + +function NewIntlPluralRules() { + let obj = new Intl.PluralRules(); +} +createSuite('NewIntlPluralRules', 100, NewIntlPluralRules, ()=>{}); + +function NewIntlListFormat() { + let obj = new Intl.ListFormat(); +} +createSuite('NewIntlListFormat', 100, NewIntlListFormat, ()=>{}); + +function NewIntlRelativeTimeFormat() { + let obj = new Intl.RelativeTimeFormat(); +} +createSuite('NewIntlRelativeTimeFormat', 100, NewIntlRelativeTimeFormat, ()=>{}); diff --git a/test/js-perf-test/Intl/run.js b/test/js-perf-test/Intl/run.js new file mode 100644 index 0000000000..61ac92a267 --- /dev/null +++ b/test/js-perf-test/Intl/run.js @@ -0,0 +1,19 @@ +// Copyright 2019 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +load('../base.js'); +load('constructor.js'); + +function PrintResult(name, result) { + console.log(name + '-Intl(Score): ' + result); +} + +function PrintError(name, error) { + PrintResult(name, error); +} + +BenchmarkSuite.config.doWarmup = undefined; +BenchmarkSuite.config.doDeterministic = undefined; + +BenchmarkSuite.RunSuites({ NotifyResult: PrintResult, + NotifyError: PrintError }); diff --git a/test/js-perf-test/JSTests.json b/test/js-perf-test/JSTests.json index 88f39b9fa8..5572a2f26f 100644 --- a/test/js-perf-test/JSTests.json +++ b/test/js-perf-test/JSTests.json @@ -1304,6 +1304,22 @@ {"name": "BitwiseOr"} ] }, + { + "name": "Intl", + "path": ["Intl"], + "main": "run.js", + "resources": [ "constructor.js" ], + "flags": [], + "results_regexp": "^%s\\-Intl\\(Score\\): (.+)$", + "tests": [ + {"name": "NewIntlCollator"}, + {"name": "NewIntlDateTimeFormat"}, + {"name": "NewIntlNumberFormat"}, + {"name": "NewIntlPluralRules"}, + {"name": "NewIntlListFormat"}, + {"name": "NewIntlRelativeTimeFormat"} + ] + }, { "name": "Inspector", "path": ["Inspector"],