Inline style vs CSS class

JavaScript performance comparison

Revision 25 of this test case created by kenny

Preparation code

<style rel='stylesheet'>
  .test { position: absolute; left: 20px; top: 20px; background-color: #f66; }
</style>
      
<script>
Benchmark.prototype.setup = function() {
  var node = document.createElement('div');

};

Benchmark.prototype.teardown = function() {
  document.body.removeChild(node);

};
</script>

Preparation code output

<style rel='stylesheet'> .test { position: absolute; left: 20px; top: 20px; background-color: #f66; } </style>

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

Revisions

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

0 Comments