Comments (2)
总结
cocos
- canvas比webgl要快,无论3.1还是3.3,这点很奇怪。
- 微信中,canvas撑300个元素就已经吃力满帧了。webgl 200个就吃力满帧。
- 3.1和3.3版本性能在本测试中区别不大,可以忽略不计
egret
这里只说官方示例,自己实现的例子,结果差距比较大。还在追。
- webgl表现明显比canvas好得多。
- 微信中,webgl可以500个满帧,canvas只能200个满帧
- 奇怪的地方,safari中,两个模式都跑不了满帧。渲染耗时很低,但就是到不了60帧。微信中没有这个问题。
微信和safari
据目前这些例子表现来总结、但并不能证明如下结果。也可能是引擎引起的问题
- safari的渲染速度比微信要快。
- safari的执行速度比微信要快。 #37
横向对比引擎
排除奇怪的cocos webgl比canvas慢,就在本例中对比。
另外,两者测试用例不一样,下面只是猜测,并不严谨。
cocos的canvas和egret的canvas比,要稍微快一点。
cocos的canvas和egret的webgl比,被秒杀。一个300满帧一个500满帧。
from bugs.
现象总结:
无论cocos还是egret,
在webgl模式下,当渲染的分辨率足够大,会发现渲染时间消耗很少(换算帧数应该满帧),但整体帧数、流畅度都很低。甚至会把电脑卡死。
追踪了一下,发现当渲染分辨率不断变大时,帧数往下掉到个位数。此时现象是渲染时间非常少,6ms,但requestAnimationFrame触发间隔却很长,完全不是16ms的间隔。或者RAF触发间隔很不平均,时长时短。
此时怀疑是RAF的实现问题。换用setTimeout强制快速触发frame。结果电脑卡死。
虽然渲染时间很少,但GPU的负担其实很高。因为是JS -> WEBGL -> 浏览器 -> GPU的过程,大概是 浏览器和GPU部分出了问题,导致实际渲染时间比JS调用 WEBGL的时间要高得多。
当时chrome直接卡死,整个系统的帧数掉到了个位数,强制关闭chrome后终于恢复正常。
记得当时微软说IE不会支持WEBGL,因为其有安全问题,想必大概说的就是这个吧。通过JS就能把机器搞死机,这个问题有点严重~~
from bugs.
Related Issues (20)
- [收藏]A*的启发式算法
- 利用二进制操作降低保存进度的空间占用 HOT 1
- 计时器包装小计 HOT 2
- 多线程性能调优小记 HOT 1
- V8对象属性访问性能测试 HOT 1
- 不要对数组进行freeze或seal操作
- V8-JS性能调优小结 HOT 1
- 初识Async Functions和await
- HTML5游戏的资源内存管理 HOT 1
- 关于JS游戏服务端的新思考 HOT 2
- 貌似Node.js要引入worker了?
- ReactNative Macos环境搭建
- ReactNative Macos的性能测试
- ReactNative Macos首屏时间开销测量
- 跨平台类RN开发框架抽象思考 HOT 3
- Rust记录之模式匹配
- 订阅发布模式的优缺点
- VirtualizedList/FlatList工作原理及实现源码 HOT 1
- React Diff算法相关信息
- SectionList 和 FlatList 的具体差异在哪里
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bugs.