Commit ddf26216 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[parser|js-perf-test] Disable compilation cache in the parsing microbrenchmarks.

Evalling multiple long strings makes compilation cache the bottleneck: See
https://bugs.chromium.org/p/v8/issues/detail?id=6779 for more information.

BUG=v8:6779

Change-Id: I0014b1aca1258a643cbeb441a82707b163f8166d
Reviewed-on: https://chromium-review.googlesource.com/649146Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47801}
parent f3c87e63
......@@ -617,6 +617,7 @@
"name": "Parsing",
"path": ["Parsing"],
"main": "run.js",
"flags": ["--no-compilation-cache", "--allow-natives-syntax"],
"resources": [ "comments.js"],
"results_regexp": "^%s\\-Parsing\\(Score\\): (.+)$",
"tests": [
......
......@@ -4,10 +4,6 @@
const iterations = 100;
// Each benchmark.run is surrounded by a loop of 100. To generate the right
// amount of test cases, we just need to know this constant.
const fixed_iterations_by_runner = 100;
new BenchmarkSuite('OneLineComment', [1000], [
new Benchmark('OneLineComment', false, true, iterations, Run, OneLineCommentSetup)
]);
......@@ -20,44 +16,26 @@ new BenchmarkSuite('MultiLineComment', [1000], [
new Benchmark('MultiLineComment', false, true, iterations, Run, MultiLineCommentSetup)
]);
let codes;
let ix;
// Functions generating the code snippets which the actual test will eval. The
// snippets need to be different for each iteration, so that we won't hit the
// compilation cache.
let code;
function OneLineCommentSetup() {
codes = [];
ix = 0;
for (let i = 0; i < iterations * fixed_iterations_by_runner; ++i) {
let code = "//" + " This is a comment... ".repeat(600) + i;
codes.push(code);
}
code = "//" + " This is a comment... ".repeat(600);
%FlattenString(code);
}
function OneLineCommentsSetup() {
codes = [];
ix = 0;
for (let i = 0; i < iterations * fixed_iterations_by_runner; ++i) {
let code = "// This is a comment.\n".repeat(600) + "\n//" + i;
codes.push(code);
}
code = "// This is a comment.\n".repeat(600);
%FlattenString(code);
}
function MultiLineCommentSetup() {
codes = [];
ix = 0;
for (let i = 0; i < iterations * fixed_iterations_by_runner; ++i) {
let code = "/*" + " This is a comment... ".repeat(600) + "*/" + i;
codes.push(code);
}
code = "/*" + " This is a comment... ".repeat(600) + "*/";
%FlattenString(code);
}
function Run() {
if (ix >= codes.length) {
throw new Error("Not enough test data");
if (code == undefined) {
throw new Error("No test data");
}
eval(codes[ix]);
++ix;
eval(code);
}
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