translate3d vs translate performance

PerformanceCss Transforms

Performance Problem Overview


We now all know, particularly from that nice article, that we should prefer css-transforms to animate position.

But we got the choice between translate() and translate3d()...

Which one is generally faster?

Performance Solutions


Solution 1 - Performance

This site below runs tests comparing translate(), translate3d(), and a couple other properties. According to it, translate3d() is faster in most browsers.

http://jsperf.com/translate3d-vs-xy

Solution 2 - Performance

The use of translate3d pushes CSS animations into hardware acceleration. Even if you're looking to do a basic 2d translation, use translate3d for more power! So 'T3d' is just better because it tells the CSS animations to push the animations in 3d power! That's why it is faster. (The answer of Cameron Little is the proof)

Solution 3 - Performance

As Cameron suggested translate3d should be faster in a lot of browsers, mostly those that use GFX hardware acceleration to speed up rendering. Especially on WebKit translate3d was the preferred way of forcing hardware acceleration on page items.

Though in my experience sometimes there is one drawback to using 3d transforms - in certain browser versions/OS combinations (macOS + Safari I'm looking at you) hardware accelerated rendering can slightly alter font smoothing as well as interpolation, thus causing minor flicker or blur. Those situations can mostly be worked around but should be kept in mind.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionabernierView Question on Stackoverflow
Solution 1 - PerformanceCameron LittleView Answer on Stackoverflow
Solution 2 - PerformanceAFCA_TimonView Answer on Stackoverflow
Solution 3 - PerformanceromanView Answer on Stackoverflow