Commit 2f17d5f8 authored by jgruber's avatar jgruber Committed by Commit bot

[js-perf-test] Move SubRegExp class definition outside loop

Defining the subclass within the loop significantly affects subsequent
test results. For instance, the Search benchmark is 50% slower if the
subclass is defined within the loop.

BUG=v8:5339

Review-Url: https://codereview.chromium.org/2537253003
Cr-Commit-Position: refs/heads/master@{#41384}
parent 9d1488e4
...@@ -26,11 +26,12 @@ function CtorWithRegExpPatternAndFlags() { ...@@ -26,11 +26,12 @@ function CtorWithRegExpPatternAndFlags() {
new RegExp(/[Cz]/, "guiym"); new RegExp(/[Cz]/, "guiym");
} }
class SubRegExp extends RegExp {
get source() { return "[Cz]"; }
get flags() { return "guiym"; }
}
function CtorWithRegExpSubclassPattern() { function CtorWithRegExpSubclassPattern() {
class SubRegExp extends RegExp {
get source() { return "[Cz]"; }
get flags() { return "guiym"; }
}
new RegExp(new SubRegExp(/[Cz]/)); new RegExp(new SubRegExp(/[Cz]/));
} }
......
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