float-css-props

JavaScript performance comparison

Revision 5 of this test case created

Preparation code

<style>

#content { border: 1px solid red; }
#inner { background: #888; }

.a { width: 100px;   border: 2px solid white; }
.b { width: 100.0px; border: 2.0px solid white; }
.c { width: 100.4px; border: 2.4px solid white; }
.d { width: 99.6px;  border: 1.6px solid white; }

</style>
<div id="content">
  <div id="inner">Hello, nurse!</div>
</div>
<script>
Benchmark.prototype.setup = function() {
    var inner = document.getElementById('inner');
};
</script>

Preparation code output

Hello, nurse!

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
int
inner.className = 'a';
pending…
float-rounded
inner.className = 'b';
pending…
float-higher
inner.className = 'c';
pending…
float-lower
inner.className = 'd';
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:

0 comments

Add a comment