From 51c631563895ff9e2b2e73c1f09116f92256a4c6 Mon Sep 17 00:00:00 2001 From: Sigurd Schneider Date: Wed, 31 Jan 2018 17:48:33 +0100 Subject: [PATCH] [js-perf-tests] Hook up new benchmarks for String.p.charCodeAt Bug: v8:7092, v8:7326, chromium:806758 Change-Id: Id8a3bc2455875af9dfdc01619d8217e033099e7e Reviewed-on: https://chromium-review.googlesource.com/895690 Commit-Queue: Benedikt Meurer Reviewed-by: Benedikt Meurer Cr-Commit-Position: refs/heads/master@{#51006} --- test/js-perf-test/JSTests.json | 9 +++++- test/js-perf-test/Strings/string-indexof.js | 32 ++++++++++----------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/test/js-perf-test/JSTests.json b/test/js-perf-test/JSTests.json index 039419d0d4..33c39ea363 100644 --- a/test/js-perf-test/JSTests.json +++ b/test/js-perf-test/JSTests.json @@ -203,7 +203,14 @@ {"name": "StringIndexOfConstant"}, {"name": "StringIndexOfNonConstant"}, {"name": "StringCharCodeAtConstant"}, - {"name": "StringCharCodeAtNonConstant"} + {"name": "StringCharCodeAtNonConstant"}, + {"name": "StringCharCodeAtConstantInbounds"}, + {"name": "StringCharCodeAtNonConstantInbounds"}, + {"name": "StringCodePointAtConstant"}, + {"name": "StringCodePointAtNonConstant"}, + {"name": "StringCodePointAtConstantInbounds"}, + {"name": "StringCodePointAtNonConstantInbounds"} + ] }, { diff --git a/test/js-perf-test/Strings/string-indexof.js b/test/js-perf-test/Strings/string-indexof.js index 306e91c105..d110ce6c0e 100644 --- a/test/js-perf-test/Strings/string-indexof.js +++ b/test/js-perf-test/Strings/string-indexof.js @@ -35,14 +35,14 @@ function StringIndexOfNonConstant() { return sum; } -new BenchmarkSuite('StringCharCodeAtConstantWithOutOfBounds', [3], [ - new Benchmark('StringCharCodeAtConstantWithOutOfBounds', true, false, 0, - StringCharCodeAtConstantWithOutOfBounds), +new BenchmarkSuite('StringCharCodeAtConstant', [3], [ + new Benchmark('StringCharCodeAtConstant', true, false, 0, + StringCharCodeAtConstant), ]); -new BenchmarkSuite('StringCharCodeAtNonConstantWithOutOfBounds', [3], [ - new Benchmark('StringCharCodeAtNonConstantWithOutOfBounds', true, false, 0, - StringCharCodeAtNonConstantWithOutOfBounds), +new BenchmarkSuite('StringCharCodeAtNonConstant', [3], [ + new Benchmark('StringCharCodeAtNonConstant', true, false, 0, + StringCharCodeAtNonConstant), ]); new BenchmarkSuite('StringCharCodeAtConstantInbounds', [3], [ @@ -59,7 +59,7 @@ const string = "qweruiplkjhgfdsazxccvbnm"; const indices = [1, 13, 32, 100, "xx"]; const indicesInbounds = [1, 7, 13, 17, "xx"]; -function StringCharCodeAtConstantWithOutOfBounds() { +function StringCharCodeAtConstant() { var sum = 0; for (var j = 0; j < indices.length - 1; ++j) { @@ -69,7 +69,7 @@ function StringCharCodeAtConstantWithOutOfBounds() { return sum; } -function StringCharCodeAtNonConstantWithOutOfBounds() { +function StringCharCodeAtNonConstant() { var sum = 0; for (var j = 0; j < indices.length - 1; ++j) { @@ -99,14 +99,14 @@ function StringCharCodeAtNonConstantInbounds() { return sum; } -new BenchmarkSuite('StringCodePointAtConstantWithOutOfBounds', [3], [ - new Benchmark('StringCodePointAtConstantWithOutOfBounds', true, false, 0, - StringCodePointAtConstantWithOutOfBounds), +new BenchmarkSuite('StringCodePointAtConstant', [3], [ + new Benchmark('StringCodePointAtConstant', true, false, 0, + StringCodePointAtConstant), ]); -new BenchmarkSuite('StringCodePointAtNonConstantWithOutOfBounds', [3], [ - new Benchmark('StringCodePointAtNonConstantWithOutOfBounds', true, false, 0, - StringCodePointAtNonConstantWithOutOfBounds), +new BenchmarkSuite('StringCodePointAtNonConstant', [3], [ + new Benchmark('StringCodePointAtNonConstant', true, false, 0, + StringCodePointAtNonConstant), ]); new BenchmarkSuite('StringCodePointAtConstantInbounds', [3], [ @@ -121,7 +121,7 @@ new BenchmarkSuite('StringCodePointAtNonConstantInbounds', [3], [ const unicode_string = "qweräϠ�𝌆krefdäϠ�𝌆ccäϠ�𝌆"; -function StringCodePointAtConstantWithOutOfBounds() { +function StringCodePointAtConstant() { var sum = 0; for (var j = 0; j < indices.length - 1; ++j) { @@ -131,7 +131,7 @@ function StringCodePointAtConstantWithOutOfBounds() { return sum; } -function StringCodePointAtNonConstantWithOutOfBounds() { +function StringCodePointAtNonConstant() { var sum = 0; for (var j = 0; j < indices.length - 1; ++j) {