Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

相比SVGA的效率提升有多少 #3

Closed
fandongtongxue opened this issue Sep 9, 2020 · 2 comments
Closed

相比SVGA的效率提升有多少 #3

fandongtongxue opened this issue Sep 9, 2020 · 2 comments

Comments

@fandongtongxue
Copy link

目前在用SVGA,想问下相比SVGA的效率提升有多少

@hexleo
Copy link
Collaborator

hexleo commented Sep 9, 2020

1 原理:
svga 原理与lottie相识,都是矢量动画方案,都是使用CPU进行绘制(开启硬件加速也只是canvas的硬件加速),从实现原理上来说,支持的特效样式有限,而且复杂动画性能低下(这个只测试了lottie,结论不一定适用svga)。

2 单帧解码时间对比:
矢量动画使用CPU做复杂动画与GPU播放视频(vap实质是视频方案)单帧耗时对比,CPU可能需要10+ms,动画越复杂时间越长(当然简单的矢量动画效率会更高,但限定在简单的动画效果,这个只测试了lottie,结论不一定适用svga);而视频解码1-3ms,无论内容多复杂,视频解码时间基本不会有太大波动。

3 实现效果上对比:
矢量动画方案天生决定某些特效无法支持,或者说代价异常高(比如复杂的粒子特效)。而vap实质是视频方案,理论上所有的视觉特效都能支持。

@fandongtongxue
Copy link
Author

好的,我了解了,谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants