# 플레이 모드 및 에디터 프로필 샘플

> Understand the difference between profiling data collected in Play mode and the data collected in the Editor.

Unity 에디터 또는 플레이 모드를 프로파일링할 때 Unity는 관련 타이밍을 [다음과 같은 마커](/engine/6000.0/manual/analysis/profiler/markers.md)가 있는 두 개의 샘플 그룹으로 그룹화합니다.

* `PlayerLoop`: 플레이 모드와 관련된 타이밍
* `EditorLoop`: 에디터와 관련된 타이밍

## 플레이 모드 샘플

플레이 모드를 프로파일링할 때 프로파일러는 `PlayerLoop` 내에서 발생한 타이밍 샘플만 수집합니다. 이 그룹은 [CPU](/engine/6000.0/manual/analysis/profiler/collect-data/visualizing-data/cpu/cpu.md) 및 [GPU 프로파일러 모듈](/engine/6000.0/manual/rendering-and-post-processing/graphics-performance-profiling/profile-rendering/profiler-gpu.md)에서 잘못된 측정값을 줄이는 데 도움이 됩니다.

Unity는 모든 `EditorLoop` 샘플을 [CPU 프로파일러 모듈 차트](/engine/6000.0/manual/analysis/profiler/collect-data/visualizing-data/cpu/cpu.md)에서 **Others** 샘플로 분류합니다. 즉, `EditorLoop` 샘플은 **Others** 카테고리에 가장 큰 기여자가 됩니다. 이 시간에 에디터가 수행하는 작업을 알아보고 **Others** 카테고리에 기여하는 항목에 대한 자세한 분석을 확인하려면 [에디터 프로세스를 프로파일링](/engine/6000.0/manual/analysis/profiler/collect-data/profiling-applications/profiling-edit-mode.md)합니다.

**중요:** [딥 프로파일링](/engine/6000.0/manual/analysis/profiler/collect-data/deep-profiling.md)을 사용하고 플레이 모드를 타겟으로 설정하면 `PlayerLoop`와 `EditorLoop`에서 발생하는 모든 호출에 성능적으로 영향을 미칩니다. 이는 딥 프로파일링이 도메인 리로드 시 스크립팅 메서드 호출의 시작과 끝에 연결되며 `PlayerLoop`에서 호출되지 않는 부분을 감지하지 못하기 때문입니다. `EditorLoop`에서 발생하는 메서드 호출에는 샘플 생성에 따른 전체 오버헤드가 없지만, 샘플을 방출하는지 계속 확인하므로 오버헤드가 줄어듭니다.

## 에디터 샘플

[에디터 프로세스를 프로파일링](/engine/6000.0/manual/analysis/profiler/collect-data/profiling-applications/profiling-edit-mode.md)할 때 이전에 `EditorLoop` 마커 아래에 숨겨진 모든 샘플이 각 카테고리에 기여합니다. 즉, [CPU Profiler 모듈의 세부 정보 창](/engine/6000.0/manual/analysis/profiler/collect-data/visualizing-data/cpu/cpu.md) 및 차트의 정보가 많이 변경됩니다.

[Unity 에디터에서 프로파일링](/engine/6000.0/manual/analysis/profiler/collect-data/profiling-applications/profiling-edit-mode.md)할 때만 표시되는 특정 [프로파일러 마커](/engine/6000.0/manual/analysis/profiler/markers.md)가 있습니다. 이러한 마커는 플레이어 관련 활동에 표시되지 않으며, 에디터 활동만 관련이 있습니다. 에디터 전용 마커에는 다음이 포함됩니다.

* null 컴포넌트 사용을 식별하는 데 도움이 되는 GetComponentNullErrorWrapper 같은 보안 검사
* 오브젝트 설정을 검사하는 CheckConsistency
* 파괴를 확인하는 CheckAllowDestructionRecursive
* 프리팹 관련 활동

기본적으로 [CPU Profiler 모듈의 **계층 구조** 뷰](/engine/6000.0/manual/analysis/profiler/collect-data/visualizing-data/cpu/cpu.md)에서는 에디터 전용 마커가 있는 샘플 스택이 축소되고 이름이 `EditorOnly [SampleName]`입니다. 이러한 샘플 스택이나 해당 자식 샘플은 가비지 컬렉션을 트리거할 수 있는 관리되는 할당을 유발할 수 있지만, 축소되면 부모 샘플의 `GC.Alloc` 값에 기여하지 않습니다.

기본 동작을 변경하려면 모듈 세부 정보 창의 오른쪽 상단에서 컨텍스트 메뉴를 선택하고 [Collapse EditorOnly Samples](/engine/6000.0/manual/analysis/profiler/collect-data/visualizing-data/cpu/cpu.md) 설정을 비활성화합니다. 이렇게 하면 샘플을 확장하고 해당 `GC.Alloc` 값을 포함하는 마커에 기여할 수 있습니다.

이 옵션은 **Timeline** 뷰에 영향을 주지 않으며 샘플과 해당 자식이 확장된 것처럼 표시됩니다. 이러한 마커를 사용하는 샘플은 일반적으로 에디터 전용 활동과 관련되어 관리되는 할당을 줄이는 데 영향을 미치지 않으므로 무시할 수 있습니다. 하지만 플레이 모드에서 성능에 상당한 영향을 미치는지 확인하는 데 유용할 수 있습니다.

## 추가 리소스

* [플레이 모드에서 성능 데이터 수집](/engine/6000.0/manual/analysis/profiler/collect-data/profiling-applications/profiling-play-mode.md)
* [Unity 에디터에 대한 성능 데이터 수집](/engine/6000.0/manual/analysis/profiler/collect-data/profiling-applications/profiling-edit-mode.md)
* [CPU 사용 프로파일러 모듈](/engine/6000.0/manual/analysis/profiler/collect-data/visualizing-data/cpu/cpu.md)
* [프로파일러 마커 레퍼런스](/engine/6000.0/manual/analysis/profiler/markers.md)
