{"ScriptPreparationCode":"function createTestElement(threshold = 0.5) {\r\n const element = document.createElement(\u0027div\u0027);\r\n if (Math.random() \u003E 0.8) {\r\n element.setAttribute(\u0027data-test\u0027, \u0027foo\u0027);\r\n }\r\n\r\n while (Math.random() \u003E threshold) {\r\n element.append(createTestElement(threshold \u002B 0.1));\r\n }\r\n\r\n return element;\r\n}\r\n\r\nconst testElements = Array.from({\r\n length: 100\r\n}, () =\u003E createTestElement());","TestCases":[{"Name":"querySelectorAll","Code":"testElements.forEach((el) =\u003E {\r\n const matches = el.querySelectorAll(\u0027[data-test]\u0027);\r\n matches.forEach(() =\u003E {});\r\n});","IsDeferred":false},{"Name":"querySelector \u002B querySelectorAll","Code":"testElements.forEach((el) =\u003E {\r\n if (el.querySelector(\u0027[data-test]\u0027)) {\r\n const matches = el.querySelectorAll(\u0027[data-test]\u0027);\r\n matches.forEach(() =\u003E {});\r\n }\r\n});","IsDeferred":false},{"Name":"querySelectorAll again (in case of caching)","Code":"testElements.forEach((el) =\u003E {\r\n const matches = el.querySelectorAll(\u0027[data-test]\u0027);\r\n matches.forEach(() =\u003E {});\r\n});","IsDeferred":false}]}