Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
test20180605-2
(version: 0)
Comparing performance of:
object vs filtres vs checkbox
Created:
7 years ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<div class="filtres"> <ul> <li class="titol"> <label>Tramitació sector</label> <ul> <li class="opcio"> <input id="tramitacio_pdu" type="checkbox"> <label for="tramitacio_pdu">Tramitació via PDU</label> </li> <li class="opcio"> <input id="tramitacio_ordinaria" type="checkbox" checked> <label for="tramitacio_ordinaria">Tramitació ordinaria</label> </li> </ul> </li> <li class="titol"> <label>Ús sector</label> <ul> <li class="opcio"> <input id="us_sae" type="checkbox" checked> <label for="us_sae">Activitat econòmica</label> </li> <li class="opcio"> <input id="us_res" type="checkbox" checked> <label for="us_res">Residencial</label> </li> <li class="opcio"> <input id="us_mix" type="checkbox" checked> <label for="us_mix">Mixt</label> </li> </ul> </li> <li class="titol"> <label>Estat sector</label> <ul> <li class="opcio"> <input id="estat_programacio" type="checkbox" checked> <label for="estat_programacio">Programació</label> </li> <li class="opcio"> <input id="estat_produccio" type="checkbox" checked> <label for="estat_produccio">Producció</label> </li> <li class="opcio"> <input id="estat_estoc" type="checkbox" checked> <label for="estat_estoc">Estoc</label> </li> </ul> </li> </ul> </div>
Script Preparation code:
var filtres = { tramitacio_pdu: true, tramitacio_ordinaria: true, us_sae: true, us_res: true, us_mix: true, estat_programacio: true, estat_produccio: true, estat_estoc: true }; var tramitacio_pdu = true; var tramitacio_ordinaria = true; var us_sae = true; var us_res = true; var us_mix = true; var estat_programacio = true; var estat_produccio = true; var estat_estoc = true; var tramitacio_pdu_c = document.getElementById('tramitacio_pdu');
Tests:
object
filtres.tramitacio_pdu
filtres
tramitacio_pdu
checkbox
tramitacio_pdu_c.checked
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
object
filtres
checkbox
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
gemma2:9b
, generated one year ago):
This benchmark tests the performance of accessing and manipulating checkbox elements in a web page. Let's break down the details: **What is being tested:** The benchmark compares three different approaches to checking the state of a checkbox and potentially modifying it: 1. **"filtres"**: This likely involves working with the entire "filters" (filtres) element, possibly by iterating through its child elements to find specific checkboxes. 2. **"object"**: This might involve directly accessing the checkbox element using an object reference, potentially obtained from a previous stage or variable. 3. **"checkbox"**: This directly targets and checks the `checked` property of the checkbox element (`tramitacio_pdu_c`). **Options compared and their pros/cons:** * **"filtres"**: Might be slower due to needing to traverse multiple elements, especially if the filtering mechanism is complex. However, it could be more flexible for managing a larger set of checkboxes. * **"object"**: Potentially faster than "filtres" because you have a direct reference to the checkbox element. * **"checkbox"**: This is likely the fastest approach as it directly accesses the desired property without needing to navigate through any parent elements. **Other considerations:** * **JavaScript Engine and Browser**: The benchmark results can vary depending on the specific JavaScript engine (e.g., V8 in Chrome) and browser being used. * **DOM Complexity**: The size and structure of the HTML document, particularly around the "filtres" element, can impact performance. * **Caching**: Browsers often cache DOM elements to improve performance for repeated access. Let me know if you'd like a deeper dive into any specific aspect!
Related benchmarks:
testasd
Spinal Tap
jquery vs js
getBBox() vs getBoundingClientRect() vs getComputedTextLength() (long text version)
jQuery vs JS Vanilla
Comments
Confirm delete:
Do you really want to delete benchmark?