블로그 이미지
Every unexpected event is a path to learning for you. blueasa

카테고리

분류 전체보기 (2797)
Unity3D (853)
Programming (479)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (185)
협업 (61)
3DS Max (3)
Game (12)
Utility (68)
Etc (98)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (55)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday

'profiler'에 해당되는 글 2건

  1. 2024.05.28 [펌] Editor Iteration Profiler (EIP)
  2. 2014.02.27 유니티 Profiler 안드로이드 사용하기

[Github] https://github.com/Unity-Technologies/com.unity.editoriterationprofiler

 

GitHub - Unity-Technologies/com.unity.editoriterationprofiler: Assists in capturing frames from the Profiler of Domain Reloads i

Assists in capturing frames from the Profiler of Domain Reloads in the Unity Editor. Compatible with Unity 2019.3+. - Unity-Technologies/com.unity.editoriterationprofiler

github.com

--------------------------------------------------------------

 

Editor Iteration Profiler (EIP)
Before diving into the details, I will start by defining what an iteration is. An iteration is a process that contains instructions that are repeated until a condition is met. Unity relies on different types of iterations.

The Editor Iteration Profiler monitors iterations that are related to the scripting side of Unity, specifically entering and exiting playmode, assembly compilation, and assembly reload.

The tool is an attempt to empower you, our users, to understand and help you solve the common question “Why does it take so long to compile my scripts/enter playmode?”. EIP accomplishes this by monitoring profiler frames and saving them in a window where you can more easily navigate through the data the profiler produces. Additionally, the data persists for the whole lifetime of the Editor (or until it’s cleared), as opposed to the Profiler, which has a limit to the number of previously stored frames.

Disclaimer: This tool is still under development and anything could change on the API side.

High-level features summary

  • Monitor and capture profiling data from assembly reload, assembly compilation, and enter playmode.

  • Export captured data or Profiler data to a number of formats such as HTML, JSON (for chrome://tracing, which is a fast flame-graph style data visualizer), CSV, and Plaintext.

  • Export to a special type of HTML (HTML Performance Report), which attempts to minimize the number of clicks needed to get to the important areas of the profiled data, as well as aggregate possible areas of interest which could be optimized (e.g. OnEnable calls)

How to use
Compatible with 2019.3 and later. It might work with earlier versions, but it is not tested.

  1. Download the repository from GitHub - https://github.com/Unity-Technologies/com.unity.editoriterationprofiler. Alternatively, you can get it through OpenUPM: https://openupm.com/packages/com.unity.editoriterationprofiler/

  2. Place the contents in a folder in your Project’s Packages folder

  3. Open up the project and open the window from Windows → Analysis → Editor Iteration Profiler → Show Window

  4. You should see a window very similar to this


The basics
To enable the tool, you just need to click the Enable button in the window. The window doesn’t need to be open afterward: it will run in the background.


After an iteration happens, it will show up in the window as follows:





UI
Please note that the UI might change/have changed slightly, however, the functionality should be the same.



  • Enable - enables the Profiler and sets it to run in Editor mode.

  • Deep Profile - useful to get all information about managed calls. (https://docs.unity3d.com/Manual/ProfilerWindow.html#deep-profiling)

  • Flattening - attempts to reduce the number of clicks needed to get to the place that is of interest. Works by ‘collapsing’ levels which contain multiple parented items with 1 child. Useful for GUI code and Deep Profiling.

  • User Code - is an attempt to filter out engine code and only show code the User might be interested in.

  • Clear - removes recorded events and events which the EIP is looking for.

  • Collapse All - recursively collapses every item.

  • Print to Console - logs the captured data into plaintext into the console/log file.

  • Export… - dropdown to export captured data in various formats.

  • Export Profiler Data… - dropdown to choose between exporting the selected frame in the Profiler Window or exporting multiple frames, frame by frame, between 2 ranges. It will automatically export the data to a selected folder.



  • Search Bar - works as you would expect. Selecting an item and either pressing the F key or clearing the search will automatically expand the tree view to that item.

Exporters

After you have captured some data, you might want to export it. You can do this by clicking the Export… dropdown and choosing a format.





Here you can get the samples exported above for you to test out.

The Formats

Opening the HTML, you will see something similar to this:



It mostly contains the same data as the EIP Window, with the addition of the percentages. Items in square brackets “[ ]” are leaf items without any children.


The JSON format is meant to be used within Google Chrome's chrome://tracing, which works on chromium-based browsers like Google Chrome, Microsoft Edge Chromium (edge://tracing - chrome://tracing will be replaced by it if typed), Opera, etc.. It is a fast, lightweight and Editor-agnostic way to view the captured data in the flame-graph style. In this gif, we show how to load and use the file into chrome://tracing.


CSV can be used to load the data into other programs, for example. It is pretty difficult for humans to make sense of it. Also, please be aware of the ‘header’ which contains environment information in case you plan to do further processing.


Exporting Plaintext is the same as the one it is printed in the console with the “Print to Console” button. Using this, you have the option to isolate the data and not have other information which is in the Editor.log file.


The HTML Performance Report is based on the same structure as the regular HTML report, however, functionally it is different. The purpose of it is to distill the information into something humans would more easily understand. It basically does this by reducing the number of levels you have to click through to get to the areas of interest, where code diverges more.




The items in curly brackets “{ }” represent items that have more children, which were hidden due to the parents being under the minimum set threshold (currently a hard-coded value of 1%).

The colored items represent ‘buckets’ of similar data, which is grouped in one place for convenience. The total time of these items is not added to the original time, it’s only there to give an estimate for that iteration.


Known Bugs/Limitations (must read this before using it)

  • Data might overlap on chrome://tracing because timestamp mismatches between the EIP's timestamp and the Profiler timestamp (to be fixed in the future)

  • Sorting data doesn't work in-window

  • In order to get the most accurate data (especially with DeepProfile enabled), close as many Editor Windows as possible, including the EIP Window itself (it will keep working even when closed if it's Enabled). The reason is that rebuilding the Tree Hierarchy view and repainting the GUI takes time, and it will "pollute" the data you might be looking for. The more data, the more it will be polluted (Deep Profile will naturally lead to this faster). This has been mostly mitigated in 0.1.2-preview (cost is still there, just delayed so it doesn't pollute the data).

  • When clicking the Profiler Window after clicking Enable in the EIP Window, the EIP's state will be overridden to whatever the original setting in the Profiler was

  • May cause unity to crash when closing it while the EIP is Enabled

Feedback
In terms of feedback, we're especially looking for:

  • Are there any useful use-cases not covered?

  • Are there any workflows that are unclear or missing?

  • Is there anything that is unclear or that you don’t understand?

  • Are there any issues or unclear parts in the documentation or this post?


Please feel free to post any feedback in this sub-forum.

How to report bugs
Please open bugs/suggestions at https://github.com/Unity-Technologies/com.unity.editoriterationprofiler/issues.
Please describe the steps as well as include any relevant files necessary for reproduction.

Troubleshooting
If you encounter any problems, the simplest fix is usually to use the Clear button for the window. Another option you can try is through Window → Analysis → Editor Iteration Profiler → Purge Caches.

 

 

[출처] https://forum.unity.com/threads/introducing-the-editor-iteration-profiler.908390/

 

Official - Introducing the Editor Iteration Profiler

Editor Iteration Profiler (EIP) Before diving into the details, I will start by defining what an iteration is. An iteration is a process that contains...

forum.unity.com

 

반응형
Posted by blueasa
, |

유니티는 Profiler라는 기능을 지원하여 현재 사용중인 플랫폼의 어플 동작상태를 알수가있는데

폰과 연결이 되지않아 사용을 못하고있었는데 오늘 해결책을 알게되어 공유합니다.

 

1. 빌드시 Development Build 체크

2. Autoconnect Profiler 체크

 

빌드후 어플실행시 Profiler 가 실행되고, Active Profiler 에 AndroidPlayer가 보이게된다.

이때 AndroidPlayer 선택이 되지 않는다면

윈도우 커맨드창에(Console)

안드로이드SDK/platform-tools/ 폴더로 가서

 

adb forward tcp:54999 localabstract:Unity-패키지명(Product Name)

 

와 같이 입력후 다시 선택하면 됩니다.

(명령어 입력시 콘솔창에는 아무것도 어떠한 출력도 하지않고 다시 입력대기상태가됩니다.)

Profiler 를 이용하면 기기에서 어플 동작중 어떤 스크립트에서 CPU 를 얼마나 쓰다던지의 좋은 정보를 많이알수있기때문에 메모리와 퍼포먼스관련 문제를 해결하는데

큰 도움이 될꺼라 생각합니다.


* 회사메일로 공유한내용을 혹시나 도움이 되실까 올립니다 ㅎ



출처 ; http://www.gamecodi.com/board/zboard-id-GAMECODI_Talkdev-no-1919-z-2.htm 쿠하님



참조 : http://lab.gamecodi.com/board/zboard.php?id=GAMECODILAB_QnA_etc&page=1&sn1&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=2364

반응형
Posted by blueasa
, |