---
title: 코드 소개에 프로파일링 정보 추가
product: Unity Editor
version: '6000.0'
latest_version: '7000.0'
status: This page documents version 6000.0. The latest version is 7000.0.
canonical: https://docs.unity.com/ko-kr/engine/6000.0/manual/analysis/profiler/customizing/adding-information-code/intro
latest_url: https://docs.unity.com/ko-kr/engine/7000.0/manual/analysis/profiler/customizing/adding-information-code/intro.md
last_updated: 2026-10-30
generated_at: 2026-11-19T16:38:43.175Z
locale: ko-kr
---

# 코드 소개에 프로파일링 정보 추가

> 프로파일러 마커와 카운터를 사용하여 애플리케이션에 대한 특정 데이터를 수집합니다.

기본적으로 [프로파일러 창](/engine/6000.0/manual/analysis/profiler/window.md)에는 Unity의 네이티브 코드에 대한 정보가 표시됩니다. 수집하는 퍼포먼스 데이터를 정리하고 분류하기 위해 [내장 프로파일러 마커](/engine/6000.0/manual/analysis/profiler/markers.md)를 사용합니다.

프로파일러 마커를 자체 코드에 추가하여 [`ProfilerMarker` API](/engine/6000.0/script-reference/unity/profiling/profilermarker.md)를 사용하여 프로파일러 창에서 이러한 영역에 소요된 타이밍을 표시할 수 있습니다.

또한 코드에 프로파일러 카운터를 추가하여 애플리케이션의 지표에 대한 데이터를 수집하고, 이 데이터를 표시하기 위해 [커스텀 프로파일러 모듈](/engine/6000.0/manual/analysis/profiler/customizing/creating-custom-modules.md)을 사용할 수도 있습니다. 애플리케이션의 성능 변경 사항을 트래킹하려는 경우 유용합니다. 프로파일러 카운터를 코드에 추가하면 Unity 빌트인 카운터와 계측 데이터와 함께 카운터의 정보를 사용할 수 있으므로 성능 문제를 더 빠르게 조사할 수 있습니다.

코드에 메타데이터가 포함된 카운터와 마커를 추가하려면 [Unity Profiling Core](https://docs.unity3d.com/Packages/com.unity.profiling.core@latest?subfolder=/manual/index.html) 패키지를 사용해야 합니다.

> **Important:**
>
> Unity 프로파일링 코어 패키지는 코어 패키지이므로 패키지 관리자 UI에서 검색할 수 없습니다. 패키지를 설치하려면 [이름으로 추가](/engine/6000.0/manual/packages-list/managing-packages-window/upm-ui-actions/upm-ui-quick.md)(`com.unity.profiling.core`)합니다.

## 프로파일러 마커##profiler-markers

[`ProfilerMarker` API를](/engine/6000.0/script-reference/unity/profiling/profilermarker.md) 사용하여 리소스를 많이 사용하는 스크립트 코드 블록을 표시하여 Unity 프로파일러에 표시하거나, [Unity 프로파일링 코어](https://docs.unity3d.com/Packages/com.unity.profiling.core@latest) 패키지의 [`ProfilerMarker<TP1>` API를](https://docs.unity3d.com/Packages/com.unity.profiling.core@1.0/api/Unity.Profiling.ProfilerMarker-1.html) 사용하여 생성되는 각 샘플에 추가 메타데이터를 추가할 수 있습니다.

빌트인 Unity 프로파일러 모든 메서드 호출을 프로파일링하지 않기 때문에 유용할 수 있습니다. 대안은 [세부 프로파일링을 사용하는 것입니다.](/engine/6000.0/manual/analysis/profiler/deep-profiling.md) 그러나 이로 인해 애플리케이션 실행이 크게 느려지고 결과가 왜곡되는 큰 오버헤드가 발생합니다. `ProfilerMarker`를 사용하면 코드를 더 효율적으로 표시할 수 있습니다.

`ProfilerMarker`는 이름이 지정된 프로파일러 핸들을 나타내며 코드를 프로파일링하는 가장 효율적인 방법입니다. 애플리케이션의 C# 코드에서사용할 수 있습니다

Unity 프로파일러 마커를 비개발 빌드에 배포하면 프로파일러 마커에 오버헤드가 발생하지 않으므로 원하는 만큼 많은 샘플을 마킹할 수 있습니다.

Unity는 `Begin` 및 `End` 메서드를 [`ConditionalAttribute`](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.conditionalattribute?view=net-8.0)로 표시하고 조건부로 컴파일하므로 비개발 빌드에서는 실행 오버헤드가 없습니다. `Auto` 메서드는 개발 단계가 아닌 빌드에서 완전히 컴파일되지 않지만, null만 반환하도록 조건부로 컴파일되어 오버헤드가 무시됩니다. 프로파일러 마커의 필드는 릴리스 빌드에 존재하며 해당 [`IntPtr`](https://learn.microsoft.com/en-us/dotnet/api/system.intptr?view=net-8.0)인 8바이트의 메모리를 차지합니다.

또한 [`ProfilerRecorder`](/engine/6000.0/script-reference/unity/profiling/profilerrecorder.md) API는 프로파일러 마커를 사용하여 퍼포먼스 데이터를 캡처합니다. Unity 에디터 개발 플레이어에서 개발하는 동안 API 사용하여 코드의 다양한 부분에 대한 성능 개요를 얻고 성능 문제를 식별할 수 있습니다.

## 프로파일러 카운터##profiler-counters

Unity 프로파일러에 커스텀 지표를 표시하려면 [Unity 프로파일링 코어](https://docs.unity3d.com/Packages/com.unity.profiling.core@latest?subfolder=/manual/index.html) 패키지의 `ProfilerCounter` API를 사용하십시오. 프로파일러는 [`ProfilerCounter`](https://docs.unity3d.com/Packages/com.unity.profiling.core@1.0/api/Unity.Profiling.ProfilerCounter-1.html) 또는 [`ProfilerCounterValue`](https://docs.unity3d.com/Packages/com.unity.profiling.core@1.0/api/Unity.Profiling.ProfilerCounterValue-1.html)의 데이터를 표시할 수 있습니다.

Unity 프로파일러 카운터를 카테고리로 분류합니다(예: 렌더링, 스크립팅 또는 애니메이션). 커스텀 프로파일러 카운터를 Unity 프로파일링 카테고리 중 하나에 할당할 수 있습니다. 사용 가능한 프로파일러 카테고리의 전체 목록은 [`ProfilerCategory`](/engine/6000.0/script-reference/unity/profiling/profilercategory.md)를 참조하십시오.

`ProfilerCounter` 또는 `ProfilerCounterValue` API를 사용하여 애플리케이션의 지표를 추적하고 Unity 프로파일러 또는 다른 코드에 표시할 수 있습니다. 에셋 스토어 패키지 개발자는 코드에 프로파일러 카운터를 추가하여 다른 개발자가 시스템의 중요한 성능 특성을 이해하는 데 도움이 되며, 이 정보를 최적화 또는 예산 설정 툴에 사용할 수 있습니다.

다음 다이어그램은 프로파일러 카운터 데이터 흐름에 대한 개요를 보여줍니다.


**Profiler counters flow.:**
![](/api/media?file=/engine/6000.0/media/images/profiler-counter-diagram.png)

[`ProfilerRecorder`](/engine/6000.0/script-reference/unity/profiling/profilerrecorder.md) API는 애플리케이션 코드에서 프로파일러 카운터 데이터를 가져오고, [`RawFrameDataView`](/engine/6000.0/script-reference/unityeditor/profiling/rawframedataview.md) 또는 [`HierarchyFrameDataView`](/engine/6000.0/script-reference/unityeditor/profiling/hierarchyframedataview.md) API는 에디터 코드에서 프로파일러 카운터 데이터를 가져옵니다. 이 카운터 데이터는 [모듈 에디터에서 커스텀 프로파일러 모듈을 설정하여 프로파일러 창에서 시각화할 수 있습니다](/engine/6000.0/manual/analysis/profiler/customizing/adding-information-code/creating-custom-counters.md).

`ProfilerCounter` 및 `ProfilerCounterValue`는 다음 유형을 지원합니다.

* 정수
* long
* float
* 더블

## 추가 리소스##additional-resources

* [코드에 프로파일러 마커 추가](/engine/6000.0/manual/analysis/profiler/customizing/adding-information-code/add-markers-code.md)
* [코드에 프로파일러 카운터 추가](/engine/6000.0/manual/analysis/profiler/customizing/adding-information-code/add-counters-code.md)
* [프로파일러 카운터 시각화](/engine/6000.0/manual/analysis/profiler/customizing/adding-information-code/creating-custom-counters.md)
* [`ProfilerMarker` API](/engine/6000.0/script-reference/unity/profiling/profilermarker.md)
* [코어 패키지 프로파일링](https://docs.unity3d.com/Packages/com.unity.profiling.core@latest)
