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

Issue 12715003: Cleaning up document.query (Closed)

Created:
7 years, 9 months ago by blois
Modified:
7 years, 9 months ago
Reviewers:
Jacob
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Was benchmarking the differences between document.query and using the native DOM methods when available, and document.query is significantly worse in almost all scenarios. Our current document.query can be optimized about 2x by caching the RegExps being used, but this is still not enough to get close to what they should be. We special-cased a couple of queries to optimize those, but it appears that the browsers are optimizing those now as well and our optimizations are getting in the way, overall. From my tests so far, this CL brings a speed improvement to document.query for all scenarios except for the name test: document.queryAll('[name="test"]') which takes a fairly significant performance hit (runs close to 1/2 speed with this CL). This is mitigated by exposing getElementsByName which if used brings a 2x performance gain over queryAll. BUG= Committed: https://code.google.com/p/dart/source/detail?r=19831

Patch Set 1 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+154 lines, -262 lines) Patch
M samples/third_party/dromaeo/tests/dom-query-html.dart View 1 chunk +26 lines, -26 lines 0 comments Download
M sdk/lib/html/dart2js/html_dart2js.dart View 8 chunks +43 lines, -83 lines 0 comments Download
M sdk/lib/html/dartium/html_dartium.dart View 8 chunks +43 lines, -75 lines 0 comments Download
M tools/dom/docs/docs.json View 4 chunks +39 lines, -5 lines 0 comments Download
M tools/dom/scripts/htmlrenamer.py View 6 chunks +2 lines, -10 lines 0 comments Download
M tools/dom/templates/html/impl/impl_Document.darttemplate View 2 chunks +1 line, -44 lines 0 comments Download
M tools/dom/templates/html/impl/impl_Element.darttemplate View 1 chunk +0 lines, -19 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
blois
7 years, 9 months ago (2013-03-11 21:41:56 UTC) #1
Jacob
lgtm
7 years, 9 months ago (2013-03-11 21:50:08 UTC) #2
blois
7 years, 9 months ago (2013-03-12 00:39:47 UTC) #3
Message was sent while issue was closed.
Committed patchset #1 manually as r19831 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698