Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
collecting attribute values 3
(version: 2)
Comparing performance of:
walker+getAttr vs simple+getAttr vs children+getAttr vs simple+getAttr (nodes) vs loopy
Created:
6 years ago
by:
Registered User
Jump to the latest result
HTML Preparation code:
<ul class="general-tag-list"><li class="category-0" data-id="1girl"><a class="wiki-link" href="/wiki_pages/show_or_new?title=1girl">?</a> <a class="search-tag" href="/posts?tags=1girl">1girl</a> <span class="post-count" title="2554200">2554k</span></li><li class="category-0" data-id="2019"><a class="wiki-link" href="/wiki_pages/show_or_new?title=2019">?</a> <a class="search-tag" href="/posts?tags=2019">2019</a> <span class="post-count" title="1485">1.5k</span></li><li class="category-0" data-id="animal ears"><a class="wiki-link" href="/wiki_pages/show_or_new?title=animal_ears">?</a> <a class="search-tag" href="/posts?tags=animal_ears">animal ears</a> <span class="post-count" title="345966">345k</span></li><li class="category-0" data-id="bangs"><a class="wiki-link" href="/wiki_pages/show_or_new?title=bangs">?</a> <a class="search-tag" href="/posts?tags=bangs">bangs</a> <span class="post-count" title="490940">490k</span></li><li class="category-0" data-id="bare shoulders"><a class="wiki-link" href="/wiki_pages/show_or_new?title=bare_shoulders">?</a> <a class="search-tag" href="/posts?tags=bare_shoulders">bare shoulders</a> <span class="post-count" title="319677">319k</span></li><li class="category-0" data-id="bikini"><a class="wiki-link" href="/wiki_pages/show_or_new?title=bikini">?</a> <a class="search-tag" href="/posts?tags=bikini">bikini</a> <span class="post-count" title="170578">170k</span></li><li class="category-0" data-id="black bikini"><a class="wiki-link" href="/wiki_pages/show_or_new?title=black_bikini">?</a> <a class="search-tag" href="/posts?tags=black_bikini">black bikini</a> <span class="post-count" title="23040">23k</span></li><li class="category-0" data-id="blush"><a class="wiki-link" href="/wiki_pages/show_or_new?title=blush">?</a> <a class="search-tag" href="/posts?tags=blush">blush</a> <span class="post-count" title="1164760">1164k</span></li><li class="category-0" data-id="breasts"><a class="wiki-link" href="/wiki_pages/show_or_new?title=breasts">?</a> <a class="search-tag" href="/posts?tags=breasts">breasts</a> <span class="post-count" title="1224018">1224k</span></li><li class="category-0" data-id="brown eyes"><a class="wiki-link" href="/wiki_pages/show_or_new?title=brown_eyes">?</a> <a class="search-tag" href="/posts?tags=brown_eyes">brown eyes</a> <span class="post-count" title="422113">422k</span></li><li class="category-0" data-id="brown legwear"><a class="wiki-link" href="/wiki_pages/show_or_new?title=brown_legwear">?</a> <a class="search-tag" href="/posts?tags=brown_legwear">brown legwear</a> <span class="post-count" title="18266">18k</span></li><li class="category-0" data-id="bunny ears"><a class="wiki-link" href="/wiki_pages/show_or_new?title=bunny_ears">?</a> <a class="search-tag" href="/posts?tags=bunny_ears">bunny ears</a> <span class="post-count" title="73654">73k</span></li><li class="category-0" data-id="carrot hair ornament"><a class="wiki-link" href="/wiki_pages/show_or_new?title=carrot_hair_ornament">?</a> <a class="search-tag" href="/posts?tags=carrot_hair_ornament">carrot hair ornament</a> <span class="post-count" title="323">323</span></li><li class="category-0" data-id="closed mouth"><a class="wiki-link" href="/wiki_pages/show_or_new?title=closed_mouth">?</a> <a class="search-tag" href="/posts?tags=closed_mouth">closed mouth</a> <span class="post-count" title="192684">192k</span></li><li class="category-0" data-id="collarbone"><a class="wiki-link" href="/wiki_pages/show_or_new?title=collarbone">?</a> <a class="search-tag" href="/posts?tags=collarbone">collarbone</a> <span class="post-count" title="233695">233k</span></li><li class="category-0" data-id="cover"><a class="wiki-link" href="/wiki_pages/show_or_new?title=cover">?</a> <a class="search-tag" href="/posts?tags=cover">cover</a> <span class="post-count" title="40686">40k</span></li><li class="category-0" data-id="cover page"><a class="wiki-link" href="/wiki_pages/show_or_new?title=cover_page">?</a> <a class="search-tag" href="/posts?tags=cover_page">cover page</a> <span class="post-count" title="28101">28k</span></li><li class="category-0" data-id="doujin cover"><a class="wiki-link" href="/wiki_pages/show_or_new?title=doujin_cover">?</a> <a class="search-tag" href="/posts?tags=doujin_cover">doujin cover</a> <span class="post-count" title="15602">15k</span></li><li class="category-0" data-id="eyebrows visible through hair"><a class="wiki-link" href="/wiki_pages/show_or_new?title=eyebrows_visible_through_hair">?</a> <a class="search-tag" href="/posts?tags=eyebrows_visible_through_hair">eyebrows visible through hair</a> <span class="post-count" title="368902">368k</span></li><li class="category-0" data-id="finger to mouth"><a class="wiki-link" href="/wiki_pages/show_or_new?title=finger_to_mouth">?</a> <a class="search-tag" href="/posts?tags=finger_to_mouth">finger to mouth</a> <span class="post-count" title="16659">16k</span></li><li class="category-0" data-id="food themed hair ornament"><a class="wiki-link" href="/wiki_pages/show_or_new?title=food_themed_hair_ornament">?</a> <a class="search-tag" href="/posts?tags=food_themed_hair_ornament">food themed hair ornament</a> <span class="post-count" title="3340">3.3k</span></li><li class="category-0" data-id="hair ornament"><a class="wiki-link" href="/wiki_pages/show_or_new?title=hair_ornament">?</a> <a class="search-tag" href="/posts?tags=hair_ornament">hair ornament</a> <span class="post-count" title="497935">497k</span></li><li class="category-0" data-id="hood"><a class="wiki-link" href="/wiki_pages/show_or_new?title=hood">?</a> <a class="search-tag" href="/posts?tags=hood">hood</a> <span class="post-count" title="78596">78k</span></li><li class="category-0" data-id="hood down"><a class="wiki-link" href="/wiki_pages/show_or_new?title=hood_down">?</a> <a class="search-tag" href="/posts?tags=hood_down">hood down</a> <span class="post-count" title="15288">15k</span></li><li class="category-0" data-id="hooded jacket"><a class="wiki-link" href="/wiki_pages/show_or_new?title=hooded_jacket">?</a> <a class="search-tag" href="/posts?tags=hooded_jacket">hooded jacket</a> <span class="post-count" title="10996">10k</span></li><li class="category-0" data-id="jacket"><a class="wiki-link" href="/wiki_pages/show_or_new?title=jacket">?</a> <a class="search-tag" href="/posts?tags=jacket">jacket</a> <span class="post-count" title="184758">184k</span></li><li class="category-0" data-id="leaning forward"><a class="wiki-link" href="/wiki_pages/show_or_new?title=leaning_forward">?</a> <a class="search-tag" href="/posts?tags=leaning_forward">leaning forward</a> <span class="post-count" title="41463">41k</span></li><li class="category-0" data-id="long hair"><a class="wiki-link" href="/wiki_pages/show_or_new?title=long_hair">?</a> <a class="search-tag" href="/posts?tags=long_hair">long hair</a> <span class="post-count" title="1758400">1758k</span></li><li class="category-0" data-id="long sleeves"><a class="wiki-link" href="/wiki_pages/show_or_new?title=long_sleeves">?</a> <a class="search-tag" href="/posts?tags=long_sleeves">long sleeves</a> <span class="post-count" title="379939">379k</span></li><li class="category-0" data-id="micro bikini"><a class="wiki-link" href="/wiki_pages/show_or_new?title=micro_bikini">?</a> <a class="search-tag" href="/posts?tags=micro_bikini">micro bikini</a> <span class="post-count" title="15073">15k</span></li><li class="category-0" data-id="navel"><a class="wiki-link" href="/wiki_pages/show_or_new?title=navel">?</a> <a class="search-tag" href="/posts?tags=navel">navel</a> <span class="post-count" title="408802">408k</span></li><li class="category-0" data-id="off shoulder"><a class="wiki-link" href="/wiki_pages/show_or_new?title=off_shoulder">?</a> <a class="search-tag" href="/posts?tags=off_shoulder">off shoulder</a> <span class="post-count" title="60823">60k</span></li><li class="category-0" data-id="open clothes"><a class="wiki-link" href="/wiki_pages/show_or_new?title=open_clothes">?</a> <a class="search-tag" href="/posts?tags=open_clothes">open clothes</a> <span class="post-count" title="134092">134k</span></li><li class="category-0" data-id="open jacket"><a class="wiki-link" href="/wiki_pages/show_or_new?title=open_jacket">?</a> <a class="search-tag" href="/posts?tags=open_jacket">open jacket</a> <span class="post-count" title="35543">35k</span></li><li class="category-0" data-id="pink jacket"><a class="wiki-link" href="/wiki_pages/show_or_new?title=pink_jacket">?</a> <a class="search-tag" href="/posts?tags=pink_jacket">pink jacket</a> <span class="post-count" title="2519">2.5k</span></li><li class="category-0" data-id="sidelocks"><a class="wiki-link" href="/wiki_pages/show_or_new?title=sidelocks">?</a> <a class="search-tag" href="/posts?tags=sidelocks">sidelocks</a> <span class="post-count" title="139222">139k</span></li><li class="category-0" data-id="skindentation"><a class="wiki-link" href="/wiki_pages/show_or_new?title=skindentation">?</a> <a class="search-tag" href="/posts?tags=skindentation">skindentation</a> <span class="post-count" title="32167">32k</span></li><li class="category-0" data-id="sleeves past wrists"><a class="wiki-link" href="/wiki_pages/show_or_new?title=sleeves_past_wrists">?</a> <a class="search-tag" href="/posts?tags=sleeves_past_wrists">sleeves past wrists</a> <span class="post-count" title="42584">42k</span></li><li class="category-0" data-id="small breasts"><a class="wiki-link" href="/wiki_pages/show_or_new?title=small_breasts">?</a> <a class="search-tag" href="/posts?tags=small_breasts">small breasts</a> <span class="post-count" title="169864">169k</span></li><li class="category-0" data-id="smile"><a class="wiki-link" href="/wiki_pages/show_or_new?title=smile">?</a> <a class="search-tag" href="/posts?tags=smile">smile</a> <span class="post-count" title="1068436">1068k</span></li><li class="category-0" data-id="snowflakes"><a class="wiki-link" href="/wiki_pages/show_or_new?title=snowflakes">?</a> <a class="search-tag" href="/posts?tags=snowflakes">snowflakes</a> <span class="post-count" title="6299">6.3k</span></li><li class="category-0" data-id="solo"><a class="wiki-link" href="/wiki_pages/show_or_new?title=solo">?</a> <a class="search-tag" href="/posts?tags=solo">solo</a> <span class="post-count" title="2113336">2113k</span></li><li class="category-0" data-id="swimsuit"><a class="wiki-link" href="/wiki_pages/show_or_new?title=swimsuit">?</a> <a class="search-tag" href="/posts?tags=swimsuit">swimsuit</a> <span class="post-count" title="244860">244k</span></li><li class="category-0" data-id="thighhighs"><a class="wiki-link" href="/wiki_pages/show_or_new?title=thighhighs">?</a> <a class="search-tag" href="/posts?tags=thighhighs">thighhighs</a> <span class="post-count" title="573940">573k</span></li><li class="category-0" data-id="twintails"><a class="wiki-link" href="/wiki_pages/show_or_new?title=twintails">?</a> <a class="search-tag" href="/posts?tags=twintails">twintails</a> <span class="post-count" title="401717">401k</span></li><li class="category-0" data-id="very long hair"><a class="wiki-link" href="/wiki_pages/show_or_new?title=very_long_hair">?</a> <a class="search-tag" href="/posts?tags=very_long_hair">very long hair</a> <span class="post-count" title="334169">334k</span></li></ul>
Script Preparation code:
var ul = document.querySelector(`.general-tag-list`); var walker = document.createTreeWalker(ul, 1, null, false); var total = 0;
Tests:
walker+getAttr
{ let node = walker.currentNode = ul.firstElementChild; do { total += node.getAttribute(`data-id`).length; } while ((node = walker.nextSibling()) !== null); }
simple+getAttr
{ let node = ul.firstElementChild; do { total += node.getAttribute(`data-id`).length; } while ((node = node.nextElementSibling) !== null); }
children+getAttr
{ let xs = ul.children; for (let i = 0, n = xs.length; i < n; ++i) { total += xs[i].getAttribute(`data-id`).length; } }
simple+getAttr (nodes)
{ let node = ul.firstChild; do { total += node.getAttribute(`data-id`).length; } while ((node = node.nextSibling) !== null); }
loopy
for (let i = 0, n = ul.childElementCount, node = ul.firstChild; i < n; ++i, (node = node.nextElementSibling)) { total += node.getAttribute(`data-id`).length; }
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (5)
Previous results
Fork
Test case name
Result
walker+getAttr
simple+getAttr
children+getAttr
simple+getAttr (nodes)
loopy
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
It appears that the provided text is not a traditional programming problem, but rather a set of benchmarking results and test cases for measuring the performance of different approaches to iterating over an HTML list. Based on the test cases, it seems that the goal is to measure the time taken by various methods (walker, simple, children, loopy) to iterate over the `ul` element's children and sum up the length of their `data-id` attributes. If I had to answer, I would say that the **simple** approach is currently performing best, with an average execution per second of 172001.1875 across all test cases. This suggests that using a straightforward, simple loop to iterate over the child elements may be the most efficient way to achieve this task in Firefox 56.
Related benchmarks:
<li> getAttribute('data-id') vs <data> value
<li> getAttribute('data-id') vs <data> value 2
dataset vs getAttribute
nth child
Comments
Confirm delete:
Do you really want to delete benchmark?