translate3d vs XY (v2)

Revision 2 of this benchmark created on


Description

Original tests created by galambalazs on 13th December 2010.

Archive:

https://web.archive.org/web/20150222231214/http://jsperf.com/translate3d-vs-xy

Preparation HTML

<div id="elem" style="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
3d
for (var i = 100; i--;) {
 style.transform = `translate3d(${i}px, ${i}px, 0)`;
}
ready
XY
for (var i = 100; i--;) {
 style.transform = `translate(${i}px, ${i}px)`;
}
ready

Revisions

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