translate3d vs XY

JavaScript performance comparison

Revision 136 of this test case created by BlooDHounD

Preparation code

<div id="transform" style="background:#ccc;width:10px;height:10px;position:absolute;"></div>
<div id="translate" style="background:#ccc;width:10px;height:10px;position:absolute;"></div>
      
<script>
Benchmark.prototype.setup = function() {
  var transform = document.getElementById( 'transform' ).style;
  var translate = document.getElementById( 'translate' ).style;

};
</script>

Preparation code output

<div id="transform" style="background:#ccc;width:10px;height:10px;position:absolute;"></div> <div id="translate" style="background:#ccc;width:10px;height:10px;position:absolute;"></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
assign
Object.assign( { top: ( Math.random() * 100 ) + 'px', left: ( Math.random() * 100 ) + 'px' } );
pending…

Revisions

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

0 Comments