Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: PerformanceTests/Parser/query-selector-id-last.html

Issue 14581013: Optimized querySelector(All) when selector contains #id. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed review issues in Patch Set 2 Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « PerformanceTests/Parser/query-selector-id-deep.html ('k') | Source/core/dom/SelectorQuery.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: PerformanceTests/Parser/query-selector-id-last.html
diff --git a/PerformanceTests/Parser/query-selector-last.html b/PerformanceTests/Parser/query-selector-id-last.html
similarity index 71%
copy from PerformanceTests/Parser/query-selector-last.html
copy to PerformanceTests/Parser/query-selector-id-last.html
index 45c1cdbe9100c474d665bbc4d620a1b5034b5576..e161cd1724438e4a52785b37e23bc4f2f3e37d2c 100644
--- a/PerformanceTests/Parser/query-selector-last.html
+++ b/PerformanceTests/Parser/query-selector-id-last.html
@@ -13,15 +13,13 @@ for (var i = 0; i < 1000; i++) {
var h1 = document.createElement("h1");
h1.id = "id";
h1.className = "class";
-document.body.appendChild(h1);
+document.body.lastChild.appendChild(h1);
PerfTestRunner.measureRunsPerSecond({
- description: "This benchmark tests querySelector() for an element that appears near the tail of the document",
+ description: "This benchmark tests querySelector() for an element that appears near the tail of the document, and is a child of an element with a given id",
run: function() {
for (var i = 0; i < 100; i++) {
- document.querySelector("h1");
- document.querySelector("#id");
- document.querySelector(".class");
+ var res = document.querySelector("#foo999 > h1");
}
}});
</script>
« no previous file with comments | « PerformanceTests/Parser/query-selector-id-deep.html ('k') | Source/core/dom/SelectorQuery.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698