Commit 8ea94bb3 authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

Revert "[test] add perf tests for String.p.startsWith"

This reverts commit 5dee355f.

Reason for revert: https://ci.chromium.org/p/v8-internal/builders/luci.v8-internal.ci/v8_linux64_perf_1/4282

Original change's description:
> [test] add perf tests for String.p.startsWith
> 
> Add performance tests for String.prototype.startsWith ahead of port to
> torque in order to keep track of how performance is affected.
> 
> Bug: v8:8400
> Change-Id: Ifc753a6f13da20c1760e545a99fd693717e3acc6
> Reviewed-on: https://chromium-review.googlesource.com/c/1402934
> Commit-Queue: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58685}

TBR=jgruber@chromium.org,usharma1998@gmail.com

Change-Id: I5855b08fa5e55ab8594185a0a84a26f567e2b9d3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8400
Reviewed-on: https://chromium-review.googlesource.com/c/1404446Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58697}
parent 40ac5a39
......@@ -528,20 +528,6 @@
{"name": "endsIndex"}
]
},
{
"name": "StringStartsWith",
"main": "run.js",
"resources": [ "string-startswith.js" ],
"test_flags": [ "string-startswith" ],
"results_regexp": "^%s\\-Strings\\(Score\\): (.+)$",
"run_count": 1,
"tests": [
{"name": "DirectStringsDirectSearch"},
{"name": "ConsStringsDirectSearch"},
{"name": "DirectStringsConsSearch"},
{"name": "ConsStringsConsSearch"}
]
},
{
"name": "StringSubstring",
"main": "run.js",
......
// Copyright 2017 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 createSuite(name, count, fn) {
new BenchmarkSuite(name, [count], [new Benchmark(name, true, false, 0, fn)]);
}
const inputs = [
'I\xF1t\xEBrn\xE2ti\xF4n\xE0liz\xE6ti\xF8n\u2603\uD83D\uDCA9\uFFFD',
'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
'Integer eu augue suscipit, accumsan ipsum nec, sagittis sem.',
'In vitae pellentesque dolor. Curabitur leo nunc, luctus vitae',
'risus eget, fermentum hendrerit justo.',
'hello'.repeat(1024),
'h',
''
];
const firsts = ['I', 'Integer', 'Lorem', 'risus', 'hello'];
function simpleHelper() {
let sum = 0;
for (input of inputs) {
for (first of firsts) {
sum += input.startsWith(first);
}
}
return sum;
}
function consInputHelper() {
let sum = 0;
for (inputOne of inputs) {
for (inputTwo of inputs) {
for (first of firsts) {
sum += %ConstructConsString(inputOne, inputTwo).startsWith(first);
}
}
}
return sum;
}
function consFirstHelper() {
let sum = 0;
for (input of inputs) {
for (firstOne of firsts) {
for (firstTwo of firsts) {
sum += input.startsWith(%ConstructConsString(firstOne, firstTwo));
}
}
}
return sum;
}
function doubleConsHelper() {
let sum = 0;
for (inputOne of inputs) {
for (inputTwo of inputs) {
for (firstOne of firsts) {
for (firstTwo of firsts) {
sum += %ConstructConsString(inputOne, inputTwo).startsWith(
%ConstructConsString(firstOne, firstTwo)
);
}
}
}
}
}
createSuite('DirectStringsDirectSearch', 1000, simpleHelper);
createSuite('ConsStringsDirectSearch', 1000, consInputHelper);
createSuite('DirectStringsConsSearch', 1000, consFirstHelper);
createSuite('ConsStringsConsSearch', 1000, doubleConsHelper);
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