Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
JQuery: selector vs filter vs filter+filter
(version: 1)
find the best solution for optimize getting selected option
Comparing performance of:
SELECTOR + FILTER vs SELECTOR + FILTER + FILTER vs SELECTOR only
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<table class="table table-striped" id="node_tableEdge"> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1194154">aaa</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1194154" data-edge-type-id="2"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494108">bbb</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494108" data-edge-type-id="2"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494111">ccc</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494111" data-edge-type-id="2"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494112">ddd</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494112" data-edge-type-id="2"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494113">eee</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494113" data-edge-type-id="2"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494114">fff</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494114" data-edge-type-id="2"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494115">ggg</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494115" data-edge-type-id="2"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494116">hhh</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494116" data-edge-type-id="2"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494117">iii</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494117" data-edge-type-id="2"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494118">jjj</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494118" data-edge-type-id="2"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1194154">aaa</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1194154" data-edge-type-id="1"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494108">bbb</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494108" data-edge-type-id="1"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494111">ccc</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494111" data-edge-type-id="1"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494112">ddd</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494112" data-edge-type-id="1"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494113">eee</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494113" data-edge-type-id="1"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494114">fff</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494114" data-edge-type-id="1"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494115">ggg</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494115" data-edge-type-id="1"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494116">hhh</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494116" data-edge-type-id="1"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494117">iii</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494117" data-edge-type-id="1"><i class="fa fa-trash"></i></a></td> </tr> <tr> <td class="node_rowEdgeType">broader</td><td class="node_rowEdgeToUriLabel" title="kb:1494118">jjj</td><td class="tableColLast text-center"><a href="#" class="node_rowEdgeDel" title="Elimina" data-to-uri="kb:1494118" data-edge-type-id="1"><i class="fa fa-trash"></i></a></td> </tr> </table> <script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.0/jquery.js'></script>
Tests:
SELECTOR + FILTER
$('.node_rowEdgeDel').filter('[data-to-uri="kb:1194154"][data-edge-type-id="2"]')
SELECTOR + FILTER + FILTER
$('.node_rowEdgeDel').filter('[data-to-uri="kb:1194154"]').filter('[data-edge-type-id="2"]')
SELECTOR only
$('.node_rowEdgeDel[data-to-uri="kb:1194154"][data-edge-type-id="2"]')
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
SELECTOR + FILTER
SELECTOR + FILTER + FILTER
SELECTOR only
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser/OS:
Chrome 130 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
SELECTOR + FILTER
132428.9 Ops/sec
SELECTOR + FILTER + FILTER
127845.4 Ops/sec
SELECTOR only
379415.2 Ops/sec
Related benchmarks:
last-child
find id
Find before selectrion
Selectors or children
parent vs closest speeds
parent vs closest speeds2
JQuery: find with selected selector vs filter selected selector
bla bla
Finding rows in a table that match a selector
Comments
Confirm delete:
Do you really want to delete benchmark?