Giter Club home page Giter Club logo

Comments (2)

smallnewer avatar smallnewer commented on September 23, 2024

总结

cocos

  1. canvas比webgl要快,无论3.1还是3.3,这点很奇怪。
  2. 微信中,canvas撑300个元素就已经吃力满帧了。webgl 200个就吃力满帧。
  3. 3.1和3.3版本性能在本测试中区别不大,可以忽略不计

egret

这里只说官方示例,自己实现的例子,结果差距比较大。还在追。

  1. webgl表现明显比canvas好得多。
  2. 微信中,webgl可以500个满帧,canvas只能200个满帧
  3. 奇怪的地方,safari中,两个模式都跑不了满帧。渲染耗时很低,但就是到不了60帧。微信中没有这个问题。

微信和safari

据目前这些例子表现来总结、但并不能证明如下结果。也可能是引擎引起的问题

  1. safari的渲染速度比微信要快。
  2. safari的执行速度比微信要快。 #37

横向对比引擎

排除奇怪的cocos webgl比canvas慢,就在本例中对比。
另外,两者测试用例不一样,下面只是猜测,并不严谨。

cocos的canvas和egret的canvas比,要稍微快一点。
cocos的canvas和egret的webgl比,被秒杀。一个300满帧一个500满帧。

from bugs.

smallnewer avatar smallnewer commented on September 23, 2024

现象总结:
无论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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.