Modified: trunk/PerformanceTests/ChangeLog (227346 => 227347)
--- trunk/PerformanceTests/ChangeLog 2018-01-22 20:07:29 UTC (rev 227346)
+++ trunk/PerformanceTests/ChangeLog 2018-01-22 20:18:34 UTC (rev 227347)
@@ -1,3 +1,21 @@
+2018-01-22 Antti Koivisto <an...@apple.com>
+
+ StyleBench: Separate test for :nth pseudo classes
+ https://bugs.webkit.org/show_bug.cgi?id=181932
+
+ Reviewed by Sam Weinig.
+
+ Optimization strategies for nth are different from other structural pseudo classes (:first-child etc). Move them to a separate test.
+
+ * StyleBench/resources/style-bench.js:
+ (structuralPseudoClassConfiguration):
+ (nthPseudoClassConfiguration):
+
+ Add a new configuration.
+
+ (predefinedConfigurations):
+ (pseudoClassConfiguration): Deleted.
+
2018-01-17 Ryosuke Niwa <rn...@webkit.org>
Temporarily skip Speedometer until we fix the metrics.
Modified: trunk/PerformanceTests/StyleBench/resources/style-bench.js (227346 => 227347)
--- trunk/PerformanceTests/StyleBench/resources/style-bench.js 2018-01-22 20:07:29 UTC (rev 227346)
+++ trunk/PerformanceTests/StyleBench/resources/style-bench.js 2018-01-22 20:18:34 UTC (rev 227347)
@@ -83,16 +83,12 @@
});
}
- static pseudoClassConfiguration()
+ static structuralPseudoClassConfiguration()
{
return Object.assign(this.defaultConfiguration(), {
- name: 'Positional pseudo classes',
+ name: 'Structural pseudo classes',
pseudoClassChance: 0.1,
pseudoClasses: [
- 'nth-child(2n+1)',
- 'nth-last-child(3n)',
- 'nth-of-type(3n)',
- 'nth-last-of-type(4n)',
'first-child',
'last-child',
'first-of-type',
@@ -103,6 +99,20 @@
});
}
+ static nthPseudoClassConfiguration()
+ {
+ return Object.assign(this.defaultConfiguration(), {
+ name: ':nth pseudo classes',
+ pseudoClassChance: 0.1,
+ pseudoClasses: [
+ 'nth-child(2n+1)',
+ 'nth-last-child(3n)',
+ 'nth-of-type(3n)',
+ 'nth-last-of-type(4n)',
+ ],
+ });
+ }
+
static beforeAndAfterConfiguration()
{
return Object.assign(this.defaultConfiguration(), {
@@ -116,7 +126,8 @@
return [
this.descendantCombinatorConfiguration(),
this.siblingCombinatorConfiguration(),
- this.pseudoClassConfiguration(),
+ this.structuralPseudoClassConfiguration(),
+ this.nthPseudoClassConfiguration(),
this.beforeAndAfterConfiguration(),
];
}