getComputedStyle Perf
JavaScript performance comparison
Preparation code
<div id="test" style="box-sizing:content-box;"></div>
<div id="test2" style="box-sizing:content-box;"></div>
<script>
if (!window.getComputedStyle)
{
window.getComputedStyle =
function (element)
{
return element.currentStyle;
}
}
var div = document.getElementById("test"),
div2 = document.getElementById("test2"),
gCS = window.getComputedStyle(div);
</script>
Preparation code output
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
gCS, access, then set |
|
pending… |
just set |
|
pending… |
access then set |
|
pending… |
style access then set |
|
pending… |
gCS, access, then set to other |
|
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. Here’s a list of current revisions for this page:
- Revision 1: published by Michael Sherov
- Revision 2: published
0 comments