[Intl] Add perf test for Intl constructors
Just add tests so we can observe the number first. Got the following results $ python -u tools/run_perf.py --binary-override-path out/x64.release/d8 --filter "JSTests/Intl" test/js-perf-test/JSTests.json INFO >>> Running suite: JSTests/Intl INFO >>> Stdout (#1): NewIntlCollator-Intl(Score): 161 NewIntlDateTimeFormat-Intl(Score): 9.73 NewIntlNumberFormat-Intl(Score): 18.6 NewIntlPluralRules-Intl(Score): 18.5 NewIntlListFormat-Intl(Score): 19.4 NewIntlRelativeTimeFormat-Intl(Score): 18.7 Bug: chromium:928098 Change-Id: I59f28393af8f868de639dcb81a7b2f69ce2f0eba Reviewed-on: https://chromium-review.googlesource.com/c/1455717 Commit-Queue: Frank Tang <ftang@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Cr-Commit-Position: refs/heads/master@{#59424}
This commit is contained in:
parent
e3637a7c0c
commit
151a0afb34
32
test/js-perf-test/Intl/constructor.js
Normal file
32
test/js-perf-test/Intl/constructor.js
Normal file
@ -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, ()=>{});
|
19
test/js-perf-test/Intl/run.js
Normal file
19
test/js-perf-test/Intl/run.js
Normal file
@ -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 });
|
@ -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"],
|
||||
|
Loading…
Reference in New Issue
Block a user