Commit e15586e7 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

[Intl] Performance benchmark for String.normalize

$ python -u tools/run_perf.py --binary-override-path   out/x64.release/d8 --filter "JSTests/Strings/StringNormalize"  test/js-perf-test/JSTests.json
INFO      >>> Running suite: JSTests/Strings/StringNormalize
INFO      >>> Stdout (#1):
StringNormalize-Strings(Score): 4014
StringNormalizeNFD-Strings(Score): 742
StringNormalizeNFKC-Strings(Score): 3066
StringNormalizeNFKD-Strings(Score): 739

Bug: v8:8844
Change-Id: Ic941bafa82cead9cd0110ad7ac46e528d481189b
Reviewed-on: https://chromium-review.googlesource.com/c/1470964
Commit-Queue: Frank Tang <ftang@chromium.org>
Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59612}
parent d595e225
......@@ -482,6 +482,20 @@
{"name": "stringIndex_const"}
]
},
{
"name": "StringNormalize",
"main": "run.js",
"resources": [ "string-normalize.js" ],
"test_flags": [ "string-normalize" ],
"results_regexp": "^%s\\-Strings\\(Score\\): (.+)$",
"run_count": 1,
"tests": [
{"name": "StringNormalize"},
{"name": "StringNormalizeNFD"},
{"name": "StringNormalizeNFKC"},
{"name": "StringNormalizeNFKD"}
]
},
{
"name": "StringLocaleCompare",
"main": "run.js",
......
// 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.
new BenchmarkSuite('StringNormalize', [5], [
new Benchmark('StringNormalize', false, false, 0,
StringNormalize),
]);
new BenchmarkSuite('StringNormalizeNFD', [5], [
new Benchmark('StringNormalizeNFD', false, false, 0,
StringNormalizeNFD),
]);
new BenchmarkSuite('StringNormalizeNFKC', [5], [
new Benchmark('StringNormalizeNFKC', false, false, 0,
StringNormalizeNFKC),
]);
new BenchmarkSuite('StringNormalizeNFKD', [5], [
new Benchmark('StringNormalizeNFKD', false, false, 0,
StringNormalizeNFKD),
]);
const shortString = "àèìòùáéíóúäëïöüÿâêîôûãõñ";
function StringNormalize() {
return shortString.normalize();
}
function StringNormalizeNFD() {
return shortString.normalize("NFD");
}
function StringNormalizeNFKC() {
return shortString.normalize("NFKC");
}
function StringNormalizeNFKD() {
return shortString.normalize("NFKD");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment