开发者

CSS Transforms Performance

开发者 https://www.devze.com 2023-04-12 22:05 出处:网络
I wondered what the difference between -webkit-transform: translate(5px, 5px) and -webkit-transform: translateX(5px) translateY(5px)

I wondered what the difference between -webkit-transform: translate(5px, 5px) and -webkit-transform: translateX(5px) translateY(5px)

Is there any performance difference? Because translateX is also used for 3D transforms. So my question is: Is 开发者_StackOverflow社区there any difference in calculating the transform? Can I say that translateX is faster, because it uses the GPU? Does it?

How can I meassure the performance?


No, but -webkit-transform: translate3d(5px, 5px, 0) will be quicker. The two syntaxes you've put are the same, mine uses the 3d context.

0

精彩评论

暂无评论...
验证码 换一张
取 消