(Unty3D性能分析Proflng.docxVIP

  1. 1、本文档共9页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
  5. 5、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
  6. 6、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们
  7. 7、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
  8. 8、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
(Unty3D性能分析Proflng

性能分析 ProfilingPorts that the Unity profiler uses: Unity分析器使用的端口如下:MulticastPort : 54998组播端口:54998ListenPorts : 55000 - 55511监听端口:55000 - 55511Multicast(unittests) : 55512 - 56023多路广播(单元测试):55512 - 56023They should be accessible from within the network node. That is, the devices that youre trying to profile on should be able to see these ports on the machine with the Unity Editor with the Profiler on. 它们应当在网络节点内部是可访问的。也就是说,当设置Unity Editor的分析器为开启时,在你尝试进行分析的设备应当是可以看到这些端口的。First steps 第一步Unity relies on the CPU (heavily optimized for the SIMD part of it, like SSE on x86 or NEON on ARM) for skinning, batching, physics, user scripts, particles, etc. Unity依靠CPU(对于它的SIMD部分已被巨大的优化了,就像x86上的SSE或是ARM上的NEON一样)来进行蒙皮、批处理、物理模拟、用户脚本、粒子等工作。The GPU is used for shaders, drawcalls, image effects. GPU则被用于shaders,drawcalls和图像效果。CPU or GPU bound (CPU 或 GPU限制)Use the internal profiler to detect the CPU and GPU ms 使用内置分析器来检测CPU和GPU ms Pareto analysis 帕累托分析法A large majority of problems (80%) are produced by a few key causes (20%). 很大一部分问题(80%)是由于一小部分关键原因(20%)引起的。Use the Editor profiler to get the most problematic function calls and optimize them first. 使用编辑器分析器来得到最有问题的函数调用,并且在第一时间优化它们。 Make sure the scripts run only when necessary.确保脚本只在必要时才会运行。Use OnBecameVisible/OnBecameInvisible to disable inactive objects. 使用OnBecameVisible/OnBecameInvisible?来禁用非活跃对象。 Use coroutines if you dont need some scripts to run every frame. 如果一些脚本不需要在每一帧都运行,就使用协同函数。 // Do some stuff every frame:// 在每一帧做一些事情:情:void Update () {}//Do some stuff every 0.2 seconds:// 每0.2秒做一些事情:IEnumerator Start ()_ { while (true) { yield return new WaitForSeconds (0.2f); }}Use the .NET System.Threading.Thread class to put heavy calculations to the other thread. This allows you to run on multiple cores, but Unity API is not thread-safe. So buffer inputs and results and read and assign them on the main thread. 使用?.NET System.Threading.Thread?类来将繁重的运算放到其他线程里。这允许你在多个内核上运行,但是Unity API不是线程安全的。因此缓冲区在主线程中对它们进行输入、输出、读取、赋值。 CPU Profiling(CPU分析)

文档评论(0)

popo786 + 关注
实名认证
文档贡献者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档