Measuring Performance with the Built-in Profiler[Unity]
来源:互联网 发布:穆迪埃数据 编辑:程序博客网 时间:2024/05/16 00:25
Unity iOS and Android contain a built in profiler. The built-in profiler emits console messages from the game running on device. These messages are written every 30 seconds and will provide insight into how the game is running. Understanding what these messages mean is not always easy, but as a minimum, you should quickly be able to determine if your game is CPU or GPU bound, and if CPU bound whether it’s script code, or perhaps Mono garbage collection that is slowing you down. See later in this page to learn how to configure the built-in profiler.
What the Profiler Tells You
Here’s an example of the built-in profiler’s output.
iPhone/iPad Unity internal profiler stats:cpu-player> min: 9.8 max: 24.0 avg: 16.3cpu-ogles-drv> min: 1.8 max: 8.2 avg: 4.3cpu-waits-gpu> min: 0.8 max: 1.2 avg: 0.9cpu-present> min: 1.2 max: 3.9 avg: 1.6frametime> min: 31.9 max: 37.8 avg: 34.1draw-call #> min: 4 max: 9 avg: 6 | batched: 10tris #> min: 3590 max: 4561 avg: 3871 | batched: 3572verts #> min: 1940 max: 2487 avg: 2104 | batched: 1900player-detail> physx: 1.2 animation: 1.2 culling: 0.5 skinning: 0.0 batching: 0.2 render: 12.0 fixed-update-count: 1 .. 2mono-scripts> update: 0.5 fixedUpdate: 0.0 coroutines: 0.0 mono-memory> used heap: 233472 allocated heap: 548864 max number of collections: 1 collection total duration: 5.7
All times are measured in milliseconds per frame. You can see the minimum, maximum and average times over the last thirty frames.
General CPU Activity
Rendering Statistics
Detailed Unity Player Statistics
The player-detail section provides a detailed breakdown of what is happening inside the engine:-
Detailed Scripts Statistics
The mono-scripts section provides a detailed breakdown of the time spent executing code in the Mono runtime:
Detailed Statistics on Memory Allocated by Scripts
The mono-memory section gives you an idea of how memory is being managed by the Mono garbage collector:
Configuration
On iOS, it’s disabled by default so to enable it, you need to open the Unity-generated XCode project, select the iPhone_Profiler.h
file and change the line
#define ENABLE_INTERNAL_PROFILER 0
to
#define ENABLE_INTERNAL_PROFILER 1
Select
in the XCode menu to display the output console (GDB) and then run your project. Unity will output statistics to the console window every thirty frames.On Android, it is enabled by default. Just make sure Development Build is checked in the player settings when building, and the statistics should show up in logcat when run on the device. To view logcat, you need <span class="doc-prop">adb</span>
or the Android Debug Bridge. Once you have that, simply run the shell command <span class="doc-prop">adb logcat</span>
.
From:http://docs.unity3d.com/Manual/iphone-InternalProfiler.html
- Measuring Performance with the Built-in Profiler[Unity]
- Unity3D Open Built-in Profiler
- The CREATE DATA statement with built-in generic types
- Unity性能优化(2)-官方教程Diagnosing performance problems using the Profiler window翻译
- Correlating SQL Server Profiler with Performance Monitor
- Measuring memory in Linux (the basics)
- Measuring performance of classifiers
- MEASURING COMPUTER PERFORMANCE
- Unity Built-in Shader详解二
- Unity Built-in Shader详解三
- 【官方博客】StrictMode API for Built-In Performance Monitoring
- Measuring & Optimizing I/O Performance
- Spatial Influence - Measuring Followship in the Real World
- Using the FortiOS built-in packet sniffer
- the Primitive Built-in Types bool
- The Python Built-in Functions(内置函数)
- Get Closer to the Wire with High-Performance Sockets in .NET
- ANTS Performance Profiler 7
- Principle of Computing(2)
- 如何争取APP Store推荐位
- Android SDK Manager安装API
- 加班~~~第一天
- java中重载(Overloading)和重写(Overriding)
- Measuring Performance with the Built-in Profiler[Unity]
- CentOS用户管理及分组管理(二)
- bind2nd 和 bind1st【转】
- android - anim translate中 fromXDelta、toXDelta、fromYDelta、toXDelta属性
- Webrtc Intro - RTP RTCP SDP relevants
- CSDN积分兑换
- startActivity时报错Calling startActivity() from outside of an Activity conte
- java获取System.out输出字符串
- VS2010+QT5编程之用QTabWidget写标签页(页码)的注意事项