:visible

JavaScript performance comparison

Revision 5 of this test case created by

Preparation code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
<div class="neverOverflow" style="display:none">neverOverflow</div>
<div class="neverOverflow" style="display:block">neverOverflow</div>
<div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div>
<div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>
    

Preparation code output

<div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div> <div class="neverOverflow" style="display:none">neverOverflow</div> <div class="neverOverflow" style="display:block">neverOverflow</div> <div class="desktopNeverOverflow" style="display:none">desktopNeverOverflow</div> <div class="desktopNeverOverflow" style="display:block">desktopNeverOverflow</div>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
slow
$(".neverOverflow:visible, .desktopNeverOverflow:visible").length
pending…
Faster
$(".neverOverflow, .desktopNeverOverflow").filter(":visible").length
pending…
single slow
$(".neverOverflow:visible").length
pending…
single fast
$(".neverOverflow").is("visible").length
pending…
single filter
$(".neverOverflow").filter(":visible").length
pending…
test with div
$("div.neverOverflow, div.desktopNeverOverflow").filter(":visible").length
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL.

0 Comments

neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow
neverOverflow
desktopNeverOverflow