W3C home > Mailing lists > Public > public-browser-tools-testing@w3.org > July to September 2016

Re: Webdriver protocol. Locator strategies

From: Andreas Tolfsen <ato@mozilla.com>
Date: Mon, 4 Jul 2016 15:59:29 +0100
To: public-browser-tools-testing@w3.org
Message-Id: <702C6FFE-9BAA-453F-AA12-8D619317E5BF@mozilla.com>
On 4 Jul 2016, at 10:45, Miguel <aplicacionamedida@gmail.com> wrote:
> These locator strategies can be replicated but maybe for performance reasons, shouldn't be eliminated, because they can use document.getElementById and document.getElementsByName internally. Maybe these functions offer a better performance than document.querySelector or document.querySelectorAll.

Some rudimentary testing I did in Gecko showed that there is a notable performance penalty running document.querySelectorAll("a") vs. document.getElementsByTagName("a") on large documents, such as the HTML specification.

The first cold run tended to be the most penalised, and subsequent cached runs were less impacted. I saw similar tendencies in Blink.

This could be a bug with querySelectorAll. There were similar tendencies in Blink.

> At the same time, eliminating these locator strategies can break code of other users

The idea is that they can be patched in clients, so they would not break anyone’s code.
Received on Monday, 4 July 2016 15:00:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:09:54 UTC