Performance Profiler
A performance profiler displays performance data in a timeline. It reports how much time is spent per each frame for updating all aspects of your project: rendering nodes that are in view, updating their states, executing scripts with game logic, calculating physics, etc.性能分析器在时间轴上显示性能数据。它报告每帧花费多少时间来更新项目的各个方面:渲染可见的节点,更新其状态,使用游戏逻辑执行脚本,计算物理量等等。
With the profiler, you can:使用事件探查器,您可以:
- Detect the bottlenecks of your application检测应用程序的瓶颈
- Check if art assets optimization is required检查是否需要优化艺术品资产
- Check if code optimization is required检查是否需要代码优化
- Compare the profiling results before and after the changes比较更改前后的概要分析结果
Activate Profilers激活分析器#
To turn the profiler on, click Tools -> Performance Profiler and choose the required profiling mode:要打开分析器,请单击Tools -> Performance Profiler并选择所需的分析模式:
The following profiling modes are available:可以使用以下分析模式:
- Generic profiler shows only the general statistics block. Generic profiler仅显示常规统计信息块。
- Rendering profiler shows the detailed rendering statistics and the timeline chart. Rendering profiler显示详细的渲染统计信息和时间线图。
- Physics profiler shows the detailed physics-related statistics (within the Physics radius) and the timeline chart. Physics profiler显示了与物理相关的详细统计信息(在 Physics radius 之内)和时间线图。
- World Management profiler shows the statistics on the whole loaded world. World Management profiler显示了整个已加载世界的统计信息。
- Thread profiler shows the statistics on loading threaded resources. Thread profiler显示有关加载线程资源的统计信息。
To show profiler statistics in the in-game mode type show_profiler command and a value from 1 to 5 in the console. To disable the profiler in the in-game mode, type show_profiler 0 in the console. 要在游戏内模式下显示探查器统计信息,请键入show_profiler命令,并在控制台中输入从 1 到 5 的值。 要在游戏内模式下禁用事件探查器,请在控制台中键入 show_profiler 0 。
Generic Profiler通用分析器#
Total | Total time in milliseconds taken to both calculate and render the current frame. This is the duration of the main loop in the application execution sequence.
Total = Total CPU + Waiting GPU 计算和渲染当前帧所花费的总时间(以毫秒为单位)。这是应用程序执行顺序中的主循环的持续时间。 Total = Total CPU + Waiting GPU |
---|---|
Total CPU | Total time in milliseconds taken to prepare the current frame (including update, render, and swap). 准备当前帧(包括 update,render 和 swap )花费的总时间(以毫秒为单位)。 |
Total GPU | Total time in milliseconds taken to render the current frame on the GPU. This counter may not work on some GPUs.This counter may not work on some GPUs. This counter may not work on some GPUs.此计数器可能在某些GPU上不起作用。 |
Update | Time taken to update application logic. This includes executing all steps in the update() function of the world script. It also includes the update of states of all nodes (for example, update of the skinned animation or of a particle system to spawn new particles).
|
Render CPU | Time taken to prepare all data to be rendered in the current frame and feed rendering commands from the CPU to the GPU. If Render CPU time is too high, it signals that art assets may need to be optimized, for example:
|
Waiting GPU | Time between completing all calculations on the CPU up to the moment when the GPU has finished rendering the frame. (See the illustration). This counter is useful to analyze the bottleneck in your application's performance.
|
Interface | Time taken to render all GUI widgets.呈现所有GUI小部件所需的时间。 |
Physics | Time taken to perform all physics calculations.执行所有物理计算所需的时间。 |
Heap | Size of all memory pools allocated for the application. Unigine allocator allocates memory in pools which allows the allocation to be faster and more efficient (if USE_MEMORY directive is used, by default). As the memory is allocated in pools, the counter value increases stepwise. 为应用程序分配的所有内存池的大小。 Unigine分配器在池中分配内存,这使分配更快,更有效(默认情况下,如果使用 USE_MEMORY 指令)。随着在池中分配内存,计数器值逐步增加。 |
Memory | Size of all memory blocks allocated on demand. This counter reports how much memory in allocated pools application's resources really use.
|
System | Size of RAM memory used for the application.用于应用程序的RAM内存的大小。 |
Allocations | Number of allocation calls during the frame. (This counter reports an allocation call even if several bytes are requested to be allocated).帧期间的分配呼叫数。 (即使请求分配几个字节,此计数器也会报告分配调用。) |
Sync Threads | Number of synchronous internal engine threads (by default, the value equals to the number of available CPU cores minus 1 and is limited by 32).同步内部引擎线程数(默认情况下,该值等于可用CPU内核数减去1并受32限制)。 |
Async Threads | Number of asynchronous internal engine threads (by default, the value equals to the number of available CPU cores and is limited by 32).异步内部引擎线程的数量(默认情况下,该值等于可用CPU内核的数量,并且受32个限制)。 |
Rendering Profiler渲染配置文件#
The following statistics is displayed in addition to the generic one:除了 generic 之外,还显示以下统计信息:
Terrain Cache CPU | Amount of CPU memory cache, currently used for Landscape Terrain tiles, in megabytes.当前用于“景观地形”图块的CPU内存缓存量,以兆字节为单位。 |
---|---|
Terrain Cache GPU | Amount of VRAM cache, currently used for Landscape Terrain tiles, in megabytes.当前用于景观地形图块的VRAM缓存量,以兆字节为单位。 |
Terrain Virtual Texture | Memory amount, currently used for the Landscape Terrain virtual texture, in megabytes.当前用于“景观地形”虚拟纹理的内存量,以兆字节为单位。 |
Terrain Detail Textures | Memory amount, currently used for Landscape Terrain details, in megabytes.当前用于“地形地形”详细信息的内存量,以兆字节为单位。 |
Terrain Reload Tiles | Number of Landscape Terrain tiles that are currently awaiting reloading after being modified.修改后当前等待重新加载的“地形地形”图块的数量。 |
Terrain Reload Bounds | Number of events causing reloading of tiles (one bound may cause reloading of multiple tiles).导致重新加载图块的事件数(一个边界可能导致重新加载多个图块)。 |
Sounds | Memory amount, currently used for sound samples, in megabytes.当前用于声音采样的内存量,以兆字节为单位。 |
Meshes Limit | Maximum amount of VRAM that can be used for mesh geometry, in megabytes.可用于网格几何图形的VRAM的最大数量,以兆字节为单位。 |
Meshes | Amount of VRAM currently used for mesh geometry, in megabytes.当前用于网格几何图形的VRAM量,以兆字节为单位。 |
Textures Limit | Maximum amount of VRAM that can be used for textures, in megabytes.可用于纹理的VRAM的最大数量,以兆字节为单位。 |
Textures | VRAM amount currently used for textures, in megabytes.当前用于纹理的VRAM量,以兆字节为单位。 |
Textures Cache | VRAM amount currently used for textures cache, in megabytes.当前用于纹理缓存的VRAM量,以兆字节为单位。 |
Buffers Render | VRAM amount currently used for rendering buffers (Gbuffer, post-effects, etc.), in megabytes.当前用于渲染缓冲区(Gbuffer,后效果等)的VRAM量,以兆字节为单位。 |
Buffers Shadows | VRAM amount currently used for shadows maps, in megabytes.当前用于阴影贴图的VRAM量,以兆字节为单位。 |
Async Buffer | Memory amount currently used for the async buffer, in megabytes. Intermediate buffer to which resources are asynchronously loaded during the streaming process. Available for OpenGL only.Available for OpenGL only. Available for OpenGL only.仅适用于OpenGL。 |
Async Buffer Indices | Memory amount currently used for mesh indices buffer, in megabytes. This buffer is used to store indices of meshes asynchronously loaded during the streaming process. Available for OpenGL only.Available for OpenGL only. Available for OpenGL only.仅适用于OpenGL。 |
Grasses | VRAM amount currently used for grass nodes, in megabytes.当前用于草节点的VRAM量,以兆字节为单位。 |
Terrains | VRAM amount currently used for terrains, in megabytes.当前用于地形的VRAM量,以兆字节为单位。 |
Allocations Textures | Number of memory allocations for textures during the frame.帧期间纹理的内存分配数。 |
Compile Shaders | Number of shaders compiled during the frame.在帧期间编译的着色器的数量。 |
Dynamic Reflections | The number of dynamic reflections drawn per frame. In case of cubemap reflections, if all six faces are updated, six reflections are rendered each frame.每帧绘制的动态反射数。如果是立方体贴图反射,则如果更新了所有六个面,则每帧会渲染六个反射。 |
Lights | Number of light passes rendered per frame. This means that the counter displays the number of all light sources that are currently seen illuminating something in the viewport. This value also includes additional passes for rendering lights in the reflecting surfaces (if dynamical reflections are used). Plain 2D reflection will multiply the number of rendering passes by two, while cubemap-based reflection with six faces updated each frame will multiply the number of rendering passes by six.
Each light redraws mesh polygons it illuminates. That is why the higher the number of light sources, the higher the number of polygons the graphics card has to render, and the lower the performance. For example, using two omni lights will as much as double the rendered geometry they shine on.Each light redraws mesh polygons it illuminates. That is why the higher the number of light sources, the higher the number of polygons the graphics card has to render, and the lower the performance. For example, using two omni lights will as much as double the rendered geometry they shine on. Each light redraws mesh polygons it illuminates. That is why the higher the number of light sources, the higher the number of polygons the graphics card has to render, and the lower the performance. For example, using two omni lights will as much as double the rendered geometry they shine on.每个灯光都会重绘其照亮的网格多边形。这就是为什么光源数量越多,图形卡必须渲染的多边形数量越多,性能越低的原因。例如,使用两个全向光源将使它们照亮的渲染几何体增加一倍。 |
Shadows | Number of shadow passes rendered per frame. Each light requires a shadow pass to calculate the shadows. Again, if there are reflecting surfaces with shadows drawn reflected, this will increase the number of shadow passes.每帧渲染的阴影遍数。每盏灯都需要经过阴影才能计算出阴影。同样,如果有反射的表面带有绘制的阴影,则会增加阴影的通过次数。 |
Decals |
Number of decals rendered per frame (in all rendering passes).每帧渲染的贴花数量(在所有渲染遍次中)。 如果一个贴花有任何额外的效果(透明的,发光的,被光源照亮的,或有任何其他视觉效果),涉及到该贴花的额外渲染通道,该贴花将在每个相应的通道中额外渲染,因此已渲染的贴花的总数将增加。 |
Surfaces |
Number of surfaces rendered per frame (in all rendering passes).每帧渲染的曲面数(在所有渲染遍次中)。 如果一个曲面有任何额外的效果(透明,发光,由光源照明,或有任何其他视觉效果),涉及到这个曲面的额外渲染通道,这个曲面将在每个相应的通道中额外渲染,因此渲染曲面的总数将增加。 |
Triangles All | Total number of triangles rendered per frame including all polygons that are currently visible in the viewport as well as the ones rendered in the process of shadows rendering.每帧渲染的三角形总数,包括当前在视口中可见的所有多边形以及在阴影渲染过程中渲染的多边形。 |
Triangles Shadows | Number of triangles rendered per frame in the process of shadows rendering. Each light source has to redraw the geometry it illuminates, increasing the overall count of rendered triangles. In order to avoid GPU bottleneck, keep the number of dynamic light sources and their radius as low, as possible.在阴影渲染过程中每帧渲染的三角形数量。每个光源都必须重新绘制其照明的几何形状,从而增加了渲染三角形的总数。为了避免GPU瓶颈,请保持动态光源的数量及其半径尽可能小。 |
Triangles Viewport | Number of triangles rendered per frame. This includes all polygons that are currently visible in the viewport (geometry).每帧渲染的三角形数量。这包括当前在视口(几何形状)中可见的所有多边形。 |
Primitives | Number of geometric primitives rendered per frame. This includes points, lines, triangles, and polygons. The visualizer and the profiler itself also add to this counter. The value differs dramatically if tessellation is used. In this case, Triangles reports the number of triangles in the coarse mesh, while Primitives shows statistics on the number of tessellated primitives.每帧渲染的几何图元数。这包括点,线,三角形和多边形。可视化器和分析器本身也添加到此计数器中。如果使用镶嵌细分,则该值会显着不同。在这种情况下, Triangles 报告粗糙网格中的三角形数量,而 Primitives 显示有关镶嵌细分图元数量的统计信息。 |
Dips | The number of draw calls. The higher the number of identical mesh surfaces with the same material, the more effective the instancing is (enabled by default). This means, the number of draw calls is minimized offloading both the CPU and the GPU.
You can compare the number of surfaces ( Surfaces) and the number of DIPs used to render them. For example, if there are 30000 surfaces and 1000 DIPs, it means that 30 instanced surfaces of meshes are rendered per only one draw call (Surfaces/Dips). Thus the instancing provides performance boost. 抽奖电话数。 具有相同材料的相同网格曲面的数量越多,实例化效果越好(默认情况下启用)。 这意味着,绘图调用的数量得以最小化,从而减轻了CPU和GPU的负担。 您可以比较表面的数量(Surfaces)和用于渲染它们的DIP的数量。 例如,如果有30000个曲面和1000个DIP,则意味着仅一个绘制调用(Surfaces/Dips)将渲染30个实例化的网格面。 因此,实例化可提高性能。 |
Shaders | Number of shaders set per frame. (Shaders are set in each of the rendering passes; hence if only one material used, its shader still needs to be set several times. When nothing is visible and the screen is black, even in this case the composite shader is still used.) 每帧设置的着色器数量。 (在每个渲染过程中都设置了着色器;因此,如果仅使用一种材质,则仍需要对其着色器进行多次设置。当看不到任何东西且屏幕为黑色时,即使在这种情况下,组合着色器仍在使用。) |
Materials | Number of materials set per frame. (Materials are set in each of the rendering passes.)每帧设置的材料数量。 (在每个渲染过程中都设置了材料。) |
Physics Profiler物理探查器#
This profiler shows statistics within the Physics radius.此分析器显示物理半径内的统计信息。
The following statistics is displayed in addition to the generic one:除了 generic 之外,还显示以下统计信息:
PIslands | Number of physical islands within the physics radius that could be calculated separately. The lower this number, the less efficient multi-threading is.物理半径中的物理岛屿的数量,可以单独计算。此数字越低,则多线程is的效率越低。 |
---|---|
PBodies | Number of bodies within the physics radius.物理半径中的实体的数量。 |
PJoints | Number of joints within the physics radius.物理半径中的关节的数量。 |
PContacts | Total number of contacts within the physics radius; this includes contacts between the bodies (their shapes) and body-mesh contacts.物理范围内的触点总数半径;这包括物体(它们的形状)和物体与网格物体之间的接触。 |
PCollision | Duration of the collision detection phase of physic simulation when collisions between objects are found.发现对象之间的碰撞时,物理模拟的碰撞检测阶段的持续时间。 |
PResponse | Duration of the response phase when collision response is calculated and joints are solved.计算碰撞响应并解决关节时响应阶段的持续时间。 |
PIntegrate | Duration of the integrate phase when physics simulation results are applied to bodies.物理模拟结果应用于人体时积分阶段的持续时间。 |
PSimulation | Duration of all simulation phases added together.所有模拟阶段的持续时间。 |
Watch an overview of the Physics Profiler options in our video tutorial on physics.在我们的 物理学视频教程中观看Physics Profiler选项的概述。
World Management Profiler世界管理概况#
This profiler shows statistics on the whole world.此探查器显示了整个世界的统计信息。
The following statistics is displayed in addition to the generic one:除了 generic 之外,还显示以下统计信息:
WNodes | Total number of nodes in the world (both enabled and disabled).世界上的节点总数(已启用和已禁用)。 |
---|---|
WBodies | Total number of bodies in the world.世界上个实体的总数。 |
WJoints | Total number of joints in the world.世界上个关节的总数。 |
WSpawn | Time in milliseconds that the engine spends on generating content in procedural nodes (such as grass, clutters, world layers). 引擎花费在程序节点上的时间(以毫秒为单位) (例如草,杂波,世界层)。 |
Thread Profiler线程分析器#
The following statistics is displayed in addition to the generic one:除了 generic 之外,还显示以下统计信息:
AsyncQueue | Time of asynchronous loading of resources (files/meshes/images/nodes), in milliseconds.异步加载资源(文件/网格/图像/节点)的时间,以毫秒为单位。 |
---|---|
Sound | Time of asynchronous loading of sounds, in milliseconds.异步加载声音的时间,以毫秒为单位。 |
PathFind | Time of asynchronous pathfinding calculations, in milliseconds.异步寻路计算时间,以毫秒为单位。 |