zoukankan      html  css  js  c++  java
  • 第一章 检测性能问题

    Performance evaluation for most software products is a very scientific process: determine the maximum supported performance metrics (number of concurrent users, maximum allowed memory usage, CPU usage, and so on); 

    大多数软件产品的性能评估是一个非常科学的过程:决定最大支持的性能度量(并发用户的数量,最大值允许内存使用、CPU使用率等);
     
    perform load testing against the application in scenarios that try to simulate real-world behavior; gather instrumentation data from test cases; analyze the data for performance bottlenecks; complete a root-cause analysis; make changes in the configuration or application code to fix the issue; and repeat.  perform load testing against the application in scenarios that try to simulate real-world behavior; gather instrumentation data from test cases; analyze the data for performance bottlenecks; complete a root-cause analysis; make changes in the configuration or application code to fix the issue; and repeat.

    对应用程序进行负载测试场景,试图模拟现实世界的行为;收集测量数据从测试用例;分析数据的性能瓶颈;完成一个根源分析;在配置或应用程序更改代码来解决问题;和重复。对应用程序进行负载测试场景,试图模拟现实世界的行为;收集测量数据从测试用例;分析数据的性能瓶颈;完成一个根源分析;在配置或应用程序更改代码来解决问题;和重复。

    Just because game development is a very artistic process does not mean it should not be treated in equally objective and scientific ways. Our game should have a target audience in mind, who can tell us the hardware limitations our game might be under. We can perform runtime testing of our application, gather data from multiple components (CPU, GPU, memory, physics, rendering, and so on), and compare them against the desired metrics. We can use this data to identify bottlenecks in our application, perform additional instrumentation to determine the root cause of the issue, and approach the problem from a variety of angles.

    仅仅因为游戏开发是一个很艺术的过程并不意味着它不应该在同样对待客观和科学的方法。我们的游戏应该有一个目标受众,谁能告诉我们可能受到硬件限制我们的游戏。我们可以执行我们的应用程序的运行时测试,收集数据从多个组件(CPU、GPU内存、物理渲染,等等),并比较他们对理想的指标。我们可以使用这些数据来识别瓶颈在我们的应用程序中,执行额外的仪器来确定问题的根源,从不同的角度和方法问题。

    To give us the tools and knowledge to complete this process, this chapter will introduce a variety of methods that we will use throughout the book to determine whether we have a performance problem, and where the root cause of the performance issue can be found. These skills will give us the techniques we need to detect, analyze, and prove that performance issues are plaguing our Unity application, and where we should begin to make changes. In doing so, you will prepare yourselves for the remaining chapters where you will learn what can be done about the problems you’re facing.

    给我们的工具和知识来完成这个过程,本章将介绍各种方法,我们将使用在整个书来确定我们是否有性能问题,并且可以发现性能问题的根源。这些技能会给我们我们需要的技术探测、分析和证明性能问题是困扰我们的Unity应用程序中,我们应该开始做出改变。这样做,你将自己准备剩下的章节,您将学习面临的问题你可以做什么。

    We will begin with an exploration of the Unity Profiler and its myriad of features. We will then explore a handful of scripting techniques to narrow-down our search for the elusive bottleneck and conclude with some tips on making the most of both techniques.

    我们将开始探索Unity分析器和它的各种特性。我们将探索一些脚本技术来缩小我们寻找难以捉摸的瓶颈和结论充分利用这两种技术的一些建议。

    The Unity Profiler 

    The Unity Profiler is built into the Unity Editor itself, and provides an expedient way of narrowing our search for performance bottlenecks by generating usage and statistics reports on a multitude of Unity3D components during runtime:CPU usage per component of the Unity3D Engine

    1. CPU usage per component of the Unity3D Engine
    2. Rendering statistics
    3. GPU usage on several programmable pipeline steps and stages
    4. Memory usage and statistics
    5. Audio usage and statistics
    6. Physics engine usage and statistics

    Unity分析器是内置在Unity编辑器本身,并提供一个有利的方式缩小我们的搜索性能瓶颈通过生成使用和统计报告大量的Unity3D组件在运行时:

    1. CPU使用率Unity3D引擎的每个组成部分
    2. 呈现统计
    3. GPU使用量在几个可编程管线步骤和阶段
    4. 内存使用情况和统计数据
    5. 音频的使用和统计
    6. 物理引擎使用和统计数据

    Note

    With the release of Unity 5.0, Unity Technologies has made the Profiler available to all developers running the Personal Edition (the new name for the Free Edition).

    Unity5.0的发布,Unity技术使得分析器可以运行的所有开发人员的个人版(免费版)的新名字。

    This additional reporting comes with a price, however. Additional instrumentation flags will be enabled within the compiler, generating runtime logging events and a different level of automated code optimization while the Profiler is in use, which causes some additional CPU and memory overhead at runtime. This profiling cost is not completely negligible, and is likely to cause inconsistent behavior when the Profiler is toggled on and off.

     

    然而,这些额外的报告是要付出代价。额外的仪器旗帜将在编译器启用,生成运行时日志事件和不同水平的自动化代码优化在分析器使用,导致在运行时一些额外的CPU和内存开销。这个成本分析不完全可以忽略不计,可能导致不一致的行为,当分析器进行切换。

    In addition, we should always avoid using Editor Mode for any kind of profiling and benchmarking purposes due to the overhead costs of the Editor; its interface, and additional memory consumption of various objects and components. It is always better to test our application in a standalone format, on the target device, in order to get a more accurate and realistic data sample.

     

    此外,我们应该避免使用编辑模式的剖析和基准测试目的由于编辑的管理费用;它的接口,各种对象和组件的额外的内存消耗。它总是更好的测试我们的应用程序在一个独立的格式,在目标设备上,为了得到一个更精确的和现实的数据样本。

    Tip

     

    Users who are already familiar with connecting the Unity Profiler to their applications should skip to the section titled The Profiler window

    用户已经熟悉Unity分析器连接到他们的应用程序应该跳过一节分析器窗口

    Launching the Profiler 

    We will begin with a brief tutorial on how to connect our game to the Unity Profiler within a variety of contexts:

     

    1.  Local instances of the application, either through the Editor or standalone
    2. Profiling the Editor itself
    3. Local instances of the application in Unity Webplayer
    4. Remote instances of the application on an iOS device (the iPad tablet or the iPhone device)
    5. Remote instances of the application on an Android device (a tablet or phone device running Android OS)
    6. We will briefly cover the requirements for setting up the Profiler in each of these contexts.

    我们将开始一个简短的教程如何连接我们的游戏分析器在各种语境下的Unity:

     

    1. 应用程序的本地实例,通过编辑器或独立
    2. 配置编辑器本身
    3. 在Unity Webplayer应用程序的本地实例
    4. 远程应用程序的实例在iOS设备(iPhone iPad平板电脑或设备)
    5. 远程实例的应用程序在Android设备(平板电脑或手机设备运行Android操作系统)
    6. 我们将简要讨论的要求设置分析器在每种情况下。

    Editor or standalone instances

    The only way to access the Profiler is to launch it through the Unity Editor and connect it to a running instance of our application. This is the case whether we’re running our game within the Editor, running a standalone application on the local or remote device, or when we wish to profile the Editor itself.

    访问分析器的唯一方法就是通过Unity编辑器启动它并将其连接到我们的应用程序的运行实例。出现这种情况我们是否正在运行我们的游戏在编辑器中,在本地或远程设备上运行一个独立的应用程序,或者当我们希望概要文件编辑器本身。

     

    52


     

  • 相关阅读:
    Asp.net 主题 【2】
    Asp.net 主题 【1】
    登陆验证码
    Ajax进阶
    Ajax
    Django之权限管理
    Django之Form进阶
    Django之知识总结
    Django之form表单认证
    Django之ORM查询复习与cookie
  • 原文地址:https://www.cnblogs.com/jgsbwcx/p/8819800.html
Copyright © 2011-2022 走看看