<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>
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');
filtres.tramitacio_pdu
tramitacio_pdu
tramitacio_pdu_c.checked
--enable-precise-memory-info
flag.
Test case name | Result |
---|---|
object | |
filtres | |
checkbox |
Test name | Executions per second |
---|---|
object | 11060419.0 Ops/sec |
filtres | 11122978.0 Ops/sec |
checkbox | 9402154.0 Ops/sec |
Let's dive into the details of this benchmark test.
What is being tested?
The test is evaluating the performance of JavaScript code when accessing different properties on an object, specifically in relation to checkbox elements.
Test cases:
tramitacio_pdu
on an object filtres
.filtres
object.checked
property on a checkbox element with the ID tramitacio_pdu_c
.Library used:
None, this is a pure JavaScript benchmark.
Special JS features or syntax:
Options compared:
The test is comparing three different ways of accessing properties on an object:
tramitacio_pdu
property directly on the filtres
object (Test case 1).filtres
object (Test case 2).checked
) (Test case 3).Pros and cons of each approach:
Other considerations:
This test is likely evaluating the performance of different JavaScript engines or browsers when handling these specific scenarios. The results might help developers optimize their code for better performance in various environments.
Alternatives:
In general, to improve performance when accessing properties on objects:
Keep in mind that this specific test case is relatively simple and focused on a particular scenario. More complex scenarios might require more sophisticated optimization strategies.