translate3d vs translate vs css left/top vs css margin (v95)

Revision 95 of this benchmark created on


Preparation HTML

<div id="elem" style="position: absolute; background:#ccc; width:10px; height:10px;"></div>
<script>
  var elem = document.getElementById("elem");
  var style = elem.style;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
translate3d
var x = 0,
    t = '';

for (var i = 200; i--;) {
  x = i * 5;
  t = 'translate3d(' + x + 'px, 0, 0)';
  style.webkitTransform = t;
}
ready
translate
var x = 0,
    t = '';

for (var i = 200; i--;) {
  x = i * 5;
  t = 'translateX(' + x + 'px)';
  style.webkitTransform = t;
}
ready

Revisions

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