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

Side by Side Diff: PerformanceTests/Parser/query-selector-all-last.html

Issue 18732004: Add fast path for querySelector(All) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing (rebased) Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../resources/runner.js"></script> 4 <script src="../resources/runner.js"></script>
5 <script> 5 <script>
6 for (var i = 0; i < 1000; i++) { 6 for (var i = 0; i < 1000; i++) {
7 var div = document.createElement("div"); 7 var div = document.createElement("div");
8 div.id = "foo" + i; 8 div.id = "foo" + i;
9 div.className = "bar" + i; 9 div.className = "bar" + i;
10 document.body.appendChild(div); 10 document.body.appendChild(div);
11 } 11 }
12 12
13 var h1 = document.createElement("h1"); 13 var h1 = document.createElement("h1");
14 h1.id = "id"; 14 h1.id = "id";
15 h1.className = "class"; 15 h1.className = "class";
16 document.body.appendChild(h1); 16 document.body.appendChild(h1);
17 17
18 PerfTestRunner.measureRunsPerSecond({ 18 PerfTestRunner.measureRunsPerSecond({
19 description: "This benchmark tests querySelector() for an element that appea rs near the tail of the document", 19 description: "This benchmark tests querySelectorAll() for an element that ap pears near the tail of the document",
20 run: function() { 20 run: function() {
21 for (var i = 0; i < 100; i++) { 21 for (var i = 0; i < 100; i++) {
22 document.querySelector("h1"); 22 document.querySelectorAll("h1");
23 document.querySelector("#id"); 23 document.querySelectorAll("#id");
24 document.querySelector(".class"); 24 document.querySelectorAll(".class");
25 } 25 }
26 }}); 26 }});
27 </script> 27 </script>
28 </body> 28 </body>
29 </html> 29 </html>
OLDNEW
« no previous file with comments | « PerformanceTests/Parser/query-selector-all-id-last.html ('k') | Source/core/dom/SelectorQuery.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698