UnityD性能消耗分析器_第1頁
UnityD性能消耗分析器_第2頁
UnityD性能消耗分析器_第3頁
UnityD性能消耗分析器_第4頁
UnityD性能消耗分析器_第5頁
已閱讀5頁,還剩12頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

1、分析器(僅專業(yè)版)Profiler (Pro only)Date:2012-02-25 04:56The Unity P rofiler helps you to op timize your game. It rep orts for you how much time is spent in the various areas of your game. For exa mpl e, it can report the p ercentage of time spent rendering, animating or in your game logic.Unity分析器可以幫助你優(yōu)化你的

2、游戲。它為您報告在你的游戲的各個領(lǐng)域所花費(fèi)的時間。例如,它可以 報告渲染、動畫或在你的游戲邏輯花費(fèi)時間的百分比。You can play your game in the Editor with P rofiling on, and it will record p erformance data.The P rofiler window then dis pl ays the data in a timeline, so you can see the frames or areas that sp ike (take more time) than others. By clicking

3、anywhere in the timeline, the bottom section of the Profiler window will dis play detailed information for the selected frame.在編輯器中,你可以將你的游戲在分析器運(yùn)行著的狀態(tài)下運(yùn)行,它會記錄性能數(shù)據(jù)。分析器窗口,在時間軸上顯示數(shù)據(jù),所以你可以看到幀或區(qū)域峰值(比其他需要更多的時間)。在時間軸中的任何地方按一下,分析器窗口的底部區(qū)域會顯示選定的幀的詳細(xì)信息。Note that p rofiling has toinstrument your code. This inst

4、rumentation has a small i mpact on the p erformance of your game. Typi cally this overhead is small enough to not affect the game framerate. When using p rofiling it is typi cal to consider only the ratio (or p ercentage) of time sp ent in certain areas. Also, to imp rove p erformance focus on those

5、 p arts of the game that consume the most time. Compare p rofiling results before and after code changes anddetermine the imp rovementsyou measure. Sometimes changes you make to imp rove p erformance might have a negative effect on frame rate; unex pected consequences of code op timization should be

6、 exp ected.請注意,分析時必須檢測你的代碼。這檢測會對你的游戲性能有小小影響。通常情況下,這種開銷是足夠小,不會影響游戲的幀率。當(dāng)使用分析時,它是典型的考慮時間花費(fèi)在某些領(lǐng)域的比例(或百分比)。此外,為了提高性能,重點在游戲消耗的時間最多的那些部分。代碼更改前后比較分析結(jié)果,并確定您測量的改 進(jìn)。有時,您所做的更改來提高性能,可能對幀速率有負(fù)面影響;應(yīng)預(yù)計代碼優(yōu)化的意外的后果。怙 Pro-jlerAdd Profilerfe詁 Deep P = ofi:e LieM byncTinrie Active Profle;“FrmeiCPU Usage Pnrr - -carbdrre o

7、l亡*0一 PhyiiC5 Oth 1 J.lOms (LOOFPS)REndui門 q -D 17 Vai;5 ahg 心 2 VSIIMemory Tatjl Textdi hSemoiy M*shC?Gunt Miteiial CQunt Object CountAudio Playirg Sources Pjiutd Sources Aucjrc VQfSE 9*1 r I rl h rh Fri i*v*i rhiir iHuErai c hr*FunctionE. 一 TT3 勺,3k465. M6-1,斗G5斗5乙e MB136.14Total41.S MBCal IsMenV

8、C amera.Reride r- Camera .ImageEffects:、&loorriAndWoise.CinFenderImaQeC)He ightDepthOfField.OnRen deci mage 0 Di awing亍 Up d citeDerpthTex tureA CullingOverheadP hysics. SimulateMecliNoverTientMotor.OnCDllisionStayO 4nimdtion.U pctateMeshkinning.UpdateMeshSkiiinirtg.WaitForSkinThreads MeshSkiiininq.

9、 Pep areFollicle.UpdateAudiaManagei.UpdateGlowRlane.Upddte(jSendMouseEvents.DoSendMauseEventsf)ET cF戶 Ln n I 沖ri n n64Profiler windowAttach ing to Unity pl ayers附加到Unity播放器To p rofile your game running on an other device or a pl ayer running on another compu teris p ossible to connect the editor to

10、that other pl ayer.The drop downActive P rofilerall pl ayers running on the local network. These pl ayers are identified by pl ayer type and thehost name running the pl ayer i Phone PI ayer (Toms iP hone). To be able to connect to a pl ayer5%1%0二0.5%0 .2%4,3 和4.2%0.1%2.9%6.0%5.9%0.1%0.3%0.1%3.9%0 .2

11、%.3%1.5%0.8%C .4%,itwill show1631Build checkbox found in the Buildthe player must be launched with the DevelopmentSettings dialog. From here it is also po ssible to tick a checkbox to make the Editor and PI ayerAutoconnect at start up.要分析你的游戲運(yùn)行在其他設(shè)備上或者在另一臺計算機(jī)上運(yùn)行的播放器,可以連接編輯器到其他播放器。Active Profiler下拉菜單

12、顯示在本地網(wǎng)絡(luò)上運(yùn)行的所有播放器。這些播放器通過播放器的類型和運(yùn)行播放Build器的主機(jī)名iP hone Pl ayer( Toms iP hone)被識別。要能夠連接到一個播放器,播放器必須在Settings 對話框中找到Development Build復(fù)選框勾上的情況下打包生成。從這里也可以勾選一個復(fù)選框,使編輯器和播放器在啟動時自動連接。P rofiler Con trols分析器控件Add ArBI 冷 Record j Deep Frafile ,Frame: 262 f 419An I I CurieritDeep Profili ng深度分析Active Profiler )彈

13、出菜單讓你選擇是否應(yīng) iOS設(shè)備)。P rofiler controls are in the toolbar at the top of the window. Use these to turn p rofiling on and off, navigate through p rofiled frames and so on. The trans port controls are at the far right end of the toolbar . Note that when the game is running and the p rofiler is collecting

14、 data clicking on any of these trans port controls will p ause the game. The controls go to the first recorded frame, ste p one frame back, ste p one frame forward and go to the last frame resp ectively.The profiler does not keep all recorded frames, so the notion of thefirst frame should really be

15、though of as the oldest frame that is still kept in memory. The current trans port button causes the p rofile statistics window to dis play data collected in real-time. The Active Profiler popup menu allows you to select whether p rofiling should be done in the editor or a sep arate pl ayer (for exa

16、 mple, a game running on an attached iOS device).分析器控件在窗口頂部的工具欄。使用這些控件打開和關(guān)閉分析,瀏覽分析好的幀等。傳輸控件在工具欄的最右端。請注意,當(dāng)游戲運(yùn)行、分析器收集數(shù)據(jù)時,點擊任何這些傳輸控件(那兩個小箭頭)將暫停游戲??丶D(zhuǎn)到記錄的第一幀,一步一幀向前(左箭頭),一步一幀向后(右箭頭),分別去到最后一幀。分析current器不保留所有記錄的幀,因此第一幀的概念,事實上應(yīng)該是仍然保存在內(nèi)存中的最舊的一幀。按鈕會使得分析統(tǒng)計窗口顯示實時采集的數(shù)據(jù)。激活分析器(在編輯器或一個或獨立播放器進(jìn)行分析(例如,一個游戲運(yùn)行在When you

17、 turn on Dee p P rofile,all your script code is profiled - that is, all function calls are recorded. This is useful to know where exactly time is sp ent in your game code.當(dāng)你打開深度分析(Deep Profile),所有腳本代碼將被分析-也就是說,所有的函數(shù)調(diào)用被記錄。知道確切在你的游戲代碼中花費(fèi)的時間,這是有用的。very large overheadNote that Dee p P rofiling incurs a

18、and uses a lot of memory, and as aresult your game will run significantly slower while p rofiling. If you are using complex scri pt code, Deep P rofiling might not be p ossible at all. Deep p rofiling should work fast enough for small games with simple scri pting. If you find that Deep P rofiling fo

19、r your entire game causes the frame rate to drop so much that the game barely runs, you should consider not using this app roach, and instead use the app roach described below. You may find dee p p rofiling more helpful as you are designing your game and deciding how to best impi ement key features.

20、Note that for large games dee p p rofiling may cause Unity to run out of memory and so for this reason dee p p rofiling may not be p ossible.注意深度分析(Deep Profiling )會造成非常大的開銷,并使用大量的內(nèi)存,結(jié)果你的游戲在分析同時運(yùn) 行明顯變慢。如果您使用的是復(fù)雜的腳本代碼,深度分析可能不會完全有效。深度分析為使用簡單的腳本 的小游戲工作足夠快。如果您發(fā)現(xiàn)您的整個游戲在深度分析時運(yùn)行,導(dǎo)致幀速率下降很多,以至于游戲幾乎不能運(yùn)行,你應(yīng)該考慮

21、不采用這種方法,而是使用下面描述的方法。您可能會發(fā)現(xiàn)深度分析更有利于設(shè) 計你的游戲,并確定如何最好地實現(xiàn)關(guān)鍵特性。注意深度分析,對于大型游戲可能會導(dǎo)致 Unity耗盡內(nèi)存,基于這個原因,深度分析未必有效。Manually p rofiling blocks of your scri pt code will have a smaller overhead than using DeepProfiling. UseProfiler .BeginSampleand Profiler .EndSamplescripting functions to enable anddisable p rofil

22、ing around sections of code.手動分析腳本代碼塊比使用深度分析產(chǎn)生更小的開銷。使用Profiler .BeginSample和Profiler .EndSample 函數(shù),啟用和禁用分析代碼段(從 Profiler .BeginSample至U Profiler .EndSample間的代碼)。View Syn cTime查看 SyncTimeWhen running at a fixed framerate or running in sync with the vertical blank, Unity recordsthe waiting time in Wai

23、t For Target FP S. By default this amount of time is not shown in the profiler . To view how much time is spent waiting, you can toggle View SyncTime. This is also a measure of how much headroom you have before losing frames.當(dāng)運(yùn)行在一個固定的幀率或帶垂直空白同步運(yùn)行,Unity在Wait For T arget FPS記錄等待時間,默認(rèn)情況下,該段時間沒有顯示在分析器。要

24、查看等待花費(fèi)多少時間,您可以切換View SyncTime。這也是衡量多少余量你之前丟失幀。P rofiler Timeli ne分析器時間軸16m 5 tCOFP?)二 260. MR : r_6.5k JFTl.j MG:IEl&l.OkT113? at 一Memo rv-To-til AJlocated Texture Uerrnory i DtyecE CdjiIjanTOSUFFS.- CPU usjgeya 匚 ftjetrdering i_ Scrip,:一 口then滬.Rnderlngi- Draw Cl H Triangles VeniceThe upper part of

25、 the P rofiler window dis pl ays p erformance data over time. When you run a game, data is recorded each frame, and the history of the last several hundred frames is dis pl ayed. Clicking on a p articular frame will dis play its details in the lower part of the window.Different details are dis pl ay

26、ed dep ending on which timeline area is currently selected.分析器窗口的上部顯示隨著時間的推移的性能數(shù)據(jù)。當(dāng)您運(yùn)行游戲,每一幀數(shù)據(jù)被記錄,最后則會顯示幾百幀的歷史。點擊一個特定的幀上,該幀的細(xì)節(jié)將顯示在窗口的下部。具體取決于當(dāng)前選定的時間軸區(qū)域顯示不同的細(xì)節(jié)。The vertical scale of the timeline is managed automatically and will atte mpt to fill the vertical sp ace of the window. Note that to get mor

27、e detail in say the CPU Usage area you can remove the Memory and Rendering areas. Also, the spl itter between the timeline and the statistics area can be selected and dragged downward to increase the screen area used for the timeline chart.時間軸的垂直刻度是自動管理,并嘗試填補(bǔ)窗口的垂直空間。請注意,要獲得更多關(guān)于 CPU的使用率(CPUUsage)的細(xì)節(jié),

28、您可以刪除內(nèi)存(Memory )和渲染(Rendering )區(qū)域。此外,時間軸和統(tǒng)計區(qū)域之 間的分離器能被選擇和向下拖動,為時間軸圖表增加屏幕面積。The timeline consists of several areas: CPU Usage, Rendering and Memory. These areas canAdd Area在分析be removed by clicking the close button in the p anel, and re-added again using thedrop down in the P rofile Controls bar.時間軸包

29、括幾個方面:CPU使用率,渲染和內(nèi)存。這些區(qū)域可以在面板上按一下關(guān)閉按鈕刪除和控件(Profile Controls)工具欄中使用 Add Area下拉菜單再次重新添加。CPU Usage Area(CPU使用率區(qū)域)口 RecordFrofiieFrame: 22 5 # 41.916ms lEOkKl7:0rflsI -H-J宜 liptsCArbuieCahectarFhvs i匚sO1 hersProfilerAdd AreaCPU U&agera1 HierarchyDC msFunctiorToUl5elfCalbMerwry TinT Canwrilender51藥0怎輛20 B

30、5.7t- Drawing47.LK14.2K20 ES.iA Culllirig1.7KL”EK20 E0-1A tUIText RenderId掘0.7W20 BaiC ame r aJ mageLfFet tsO.OK0320 B0.0MeshSkifini ng11.iKLL刖10 B1衛(wèi)Overhead6.73fi6”7KI0 E0l7FuelCellC fowLoe kAt. U p da 壇)6,4喘532E4 B0 7ObjectRocater.Update見右舛4右0 BO.e薩 CiUJ.Repaint3傳?fi0.4丹12.1 KDm斗=.-Hr、,The CPU Usa

31、ge area dis pl ays where time is sp ent in your game. When it is selected, the lower p ane dis pl ays hierarchical time data for the selected frame.CPU使用率區(qū)域顯示你的游戲在哪里花費(fèi)時間。當(dāng)這個區(qū)域被選中,下部窗格中顯示選定的幀層次化的時 間數(shù)據(jù)。Hierarchy mode:DispI ays hierarchical time data.層級模式(Hierarchy mode ):顯示層次化的時間數(shù)據(jù)。Group Hierarchy mod

32、e:Groups time data into logical groups (Rendering, Physics,Scripts etc.). Because children of any group can be in different group (e.g. some scri ptmight call rendering functions), the p ercentages of group times often add up to morethan 100%. (This is not a bug.)組層級模式(Group Hierarchy mode ):成邏輯組的組時

33、間數(shù)據(jù)(渲染( Rendering ),物理(Physics ),腳本(Scripts )等)。因為任何組的子成員,可在不同的組(例如一些腳本可能調(diào)用渲染功能),組時間的百分比往往加起來超過100 %。(這不是一個錯誤。)The way the CPU chart is stacked can be reordered by simply dragging chart labels up &down.CPU的使用率(CPU Usage)圖表堆疊方式,可以通過簡單的上下拖動圖表標(biāo)簽進(jìn)行重新排序。When an item is selected in the lower p ane, its co

34、ntribution to the CPU chart is highlighted(and the rest are dimmed). Clicking on an item again de-selects it. 當(dāng)在下部窗格中選擇一個項目,對應(yīng)到 色)。再次點擊這個項目就會取消選擇。CPU的使用率(CPU Usage)圖表上會高亮顯示(和其余部分為灰O ProfilerAdd AraQi RKord De*p ProfifeFrame; 22 5 / 4191. CPU U&ageJ 尺 RenderingI 匚 Arba&Callertar 門護(hù)i匚s Ol kiersJSrrll1

35、 HierarchyFunaioFiTouiSelf51,1MerrwiyJifnc msT Camen Render20 B577 Drawing47丄幣t4.2K20 ES.ii MeshRcnderer.Render15 EK12%650 E1.7Shader.SetPais- - 頂噸hSaU理0 B1,&b ski nned Mesh Rend e r e r .Re nde r12KOjOWC0 b0.11亠 Partirlekenderer.lender0渤10 BO.lfc- Culllir20 BO.lCUIText.Render0.7W20 BaiCameraJnnageE

36、fFetts20 BC.OMeshskinning10 B1.2Shader.Set Pass is selected and its contribution is highlighted in the chart.Shader .SetPass被選中,圖表中高亮顯示。In the hierarchical time data the self time refers to the amount of time sp ent in a p articularfunction not including the time spent calling sub-functions. In the

37、screenshotabove,forexa mple 51.2% of time is sp ent in the Camera.Render function. This function does a lot of work and calls the various drawing and culling functions. Excluding all these functions only 0.8% of time is sp ent actually in the Camera.Render function.在分層的時間數(shù)據(jù)的自我時間(self time )指花費(fèi)在特定函數(shù)的

38、時間,不包括調(diào)用子函數(shù)所花費(fèi)的時間。在上面的截圖,例如51.2 %的時間花費(fèi)在 Camera.Render 函數(shù)。這個函數(shù)做了很多工作,并調(diào)用各種繪圖和剔除的函數(shù)。實際上排除了所有這些功能只有0.8 %的時間花費(fèi)在 Camera.Render 函數(shù)。Ren deri ng Area渲染區(qū)域C? Profiler 細(xì)d Fr-D|-ilrI 小 iR-coridi Deep Protik , Prafil* Editor Aqti-ae ProSler XRendertig G Ofw OJIi B Tri ar mlet 口 喚Fraire: 4119/ 433Sraw talk: I Tri

39、s;76D Verts 525Botched DrawCflIls: 0 BatchedTrrs: 0 Bitched Verri 0Used Textures: 1 / 0 BRerderTextures, 0 / 0 &KerdcrTcxrure Switches 0Screen/ 2專 MBVRAM usage: IS MB to 2.7 MHof 25亂0 HE)VBO Total: 15 = 170.1 KfiVBUploadi. 0=C&IB Uploads. 0 = OBShadowCQiteii.O Visible 5Mnned Meshes?0 AniirMians. 0Th

40、e Rendering area dis pl ays rendering statistics. The Number of Draw Calls, Triangles andVertices renderedis dis pl ayedgrap hicalin the timeline. The Lowerp ane dis pl aysmorerendering statisticsand these more closely match the ones shown in the GameViewRendering Statistics渲染區(qū)域顯示渲染統(tǒng)計數(shù)據(jù)。window.Draw

41、Calls ,三角形和頂點渲染數(shù)量,在時間軸上顯示以圖形的方式。下部窗格中顯示更多渲染統(tǒng)計數(shù)據(jù),這些數(shù)據(jù)與在游戲視圖渲染統(tǒng)計數(shù)據(jù)窗口顯示的數(shù)據(jù)相匹配。3 ProfilerAdd Area0 Record Deep FrofiieFrame: E32 / 4L9MemoryTotii Allsat4dTewr urt WeifTtdiy I Ohijiect Cou ntMcdwry :Total: 2GG.2 MB Delta: 0 6Texturei: 525 / IS.G MB Meshes:/ 7.9 MEAnimationCJips: 2S / 0.6 MB toraJ -Ohjeci

42、 Couirii: 6537The Memory area dis pl ays some memory usage data:內(nèi)存區(qū)域顯示一些內(nèi)存使用的數(shù)據(jù):Total Allocated is the total RAM used by the appi ication. Note that in the Unity Editorthis is memory used by everything in the editor; game builds will use much less.總分配(Total Allocated )是應(yīng)用程序所使用的總內(nèi)存。請注意,在Unity編輯器,這是在編

43、輯器中的一切使用的內(nèi)存;游戲構(gòu)建后將使用少得多的內(nèi)存。Texture Memory is the amount of video memory used by the textures in the currentframe.紋理內(nèi)存 仃exture Memory )是在當(dāng)前幀中紋理占用的顯存大小。Object Count is the total number of Objects that are created. If this number rises overtime then it means your game is creating some objects that are

44、never destroyed.對象數(shù)(Object Count)是所創(chuàng)建的對象的總數(shù)。如果這個數(shù)字隨時間不斷上升,那么它意味著你的游戲在不斷創(chuàng)造一些從不銷毀的對象。Audio Area音頻區(qū)域O ProfilerAijd Frifiler Audio B AuditJ 1敢 RmdhI Deep Protil t , Profil* Editor b tiire Profii#rPhysics Area物理學(xué)區(qū)域PfJviing Souitce&: 0Paused Sources. 0Audio Voices. 0Audio CPUU呂魚護(hù):0第Audio Memory: ZS5.0 KBM

45、ix Audio Memory Lkdg史 JBS .0KBThe Audio area dis pl ays audio statistics:音頻區(qū)域顯示音頻統(tǒng)計數(shù)據(jù):Playing Sources is the total pl aying sources in the scene at a sp ecific frame. Monitorthis to see if audio is overloaded.播放源(Playing Sources )是在特定的幀,場景上播放源的總數(shù)。監(jiān)視此,看看音頻是否被重載。? Paused Sources is the total p aused s

46、ources in the scene at a sp ecific frame. 暫停源(Paused Sources )是在特定的幀,場景上暫停源的總數(shù)。Audio Voice is the actually number of audio (FMOD channels) voices used.PlayOneShot is using voices not shown in Playing Sources.音頻聲音(Audio Voice )是實際使用音頻(FMOD頻道)聲音的數(shù)量。 PlayOneShot 使用的是不會顯示在播放源(P laying Sources)的聲音。? Audi

47、o Memory is the total RAM used by the audio engine. 音頻內(nèi)存(Audio Memory )音頻引擎所使用的內(nèi)存總量。CPU usage can be seen in the bottom. Monitor this to see if Audio alone is taking up too muchCPU.在底部可見的CPU使用率。監(jiān)察這,看看音頻是否單獨占用太多的CPU。O Profiler Aijd Fwfi徒 rFrarrw; 匚 urrsnt1報船嗣Active Rigidbodies ISteeping Kigidbodtes 0

48、Number of Contacts: 0Static Colliders.: 0 vnamic Colliders. LThe Physics area shows the following statistics about the p hysics in the scene:-物理學(xué)區(qū)域顯示下列有關(guān)場景物理學(xué)的統(tǒng)計:Active Rigidbodies is the number of rigidbodies that are not currently slee ping (ie.they are moving or just coming to rest).Active Rigidb

49、odies是指當(dāng)前活動的剛體數(shù)(也就是說,他們正移動或僅剛剛靜止)Slee ping Rigidbodies is the number of rigidbodies that are compi etely at rest andtherefore dont need to be up datedactively by the p hysics engine (see RigidbodySlee ping for further details).Sleeping Rigidbodies是指哪些靜止的剛體數(shù),因此,不需要物理引擎主動更新(詳情參見RigidbodySleeping )。Num

50、ber of Contacts is the total number of po ints of contact between all colliders inthe scene.Number of Contacts(接觸點數(shù))是指場景中的所有接觸點的總數(shù)。Static Colliders is the number of colliders attached to non-rigidbody objects (ie,objects which never move under p hysics).Static Colliders(靜態(tài)碰撞器)是指附加到非剛體物體的碰撞器數(shù)量(也就是說,物體從來不會在物理作用下移動)。Dynamic Colliders is the

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論