test body

JavaScript performance comparison

Test case created by element_removing

Preparation code

<body class="active second">
document.body.classList.contains("dairy-calf-segment") || document.body.classList.contains("no-segment")
document.body.classList.contains("dairy-calf-segment") || document.body.classList.contains("no-segment")
document.body.classList.contains("dairy-calf-segment") || document.body.classList.contains("no-segment")
</body>

Preparation code output

document.body.classList.contains("dairy-calf-segment") || document.body.classList.contains("no-segment") document.body.classList.contains("dairy-calf-segment") || document.body.classList.contains("no-segment") document.body.classList.contains("dairy-calf-segment") || document.body.classList.contains("no-segment")

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
One varriable
var body = document.body;
body.classList.contains("active") ;
body.classList.contains("second");
pending…
No varriable
document.body.classList.contains("active");
document.body.classList.contains("second");
pending…

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

Compare results of other browsers

0 comments

Add a comment