feat: profile memory report/compare + memory snapshot - #171
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XPBXJjiKtZk6DqEScTpN5D
…l single-flight Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XPBXJjiKtZk6DqEScTpN5D
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XPBXJjiKtZk6DqEScTpN5D
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XPBXJjiKtZk6DqEScTpN5D
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
메모리 프로파일링 명령 3개를 추가한다. 프레임 시간(
profile capture/compare)에 대응하는 메모리 쪽 도구다.profile memory— 메모리 카운터(total/reserved, GC, graphics, audio/video, asset-type별 count·bytes)를 N프레임(기본 30) 샘플링해 min/median/p95/max로 반환하고,Library/com.yhc509.unity-cli-bridge/memory/<reportId>.jsonsidecar에 저장한다. Unity 버전에 없는 카운터는 실패가 아니라unavailable로 보고한다.profile memory compare <base> <head>— CLI 로컬 전용. sidecar 두 개를 읽어Total Used Memorymedian 기준 verdict(regression/improvement/unchanged,--threshold기본 5%)와 카운터별 delta를 낸다. Editor가 꺼져 있어도 동작한다.profile memory snapshot—MemoryProfiler.TakeSnapshot으로.snap을 쓰고 경로+크기+flags만 반환한다..snap파싱은 하지 않는다(공개 API 없음).com.unity.memoryprofiler미설치 시 설치 안내와 함께 거부하고, profile capture와 양방향 single-flight다.sentinel 규칙(
deltaPercentAvailable), 불일치notes경고, ordinal tie-break 정렬은 기존profile compare와 동일하게 맞췄다.Protocol
wire 명령 2개(
profile-memory,profile-memory-snapshot)를 추가하지만ProtocolVersion은 7 그대로다. 7은 아직 릴리즈되지 않았으므로 추가 bump 없이 편승한다.profile memory compare는 wire 명령이 없다.Live verification
샘플 프로젝트(headless)에서 실측:
profile memoryEdit/Play 모두 성공, sidecar 생성 확인. 6000.3에서GameObject Count만 미지원으로 확인되어 카운터 목록에서 제거했고, 이후unavailable은 빈 배열이다.profile memory compare— 같은 모드/다른 모드 둘 다 검증. 모드 불일치 시notes경고,--limit초과 시truncated확인.transport: cli).profile memory snapshot— 패키지 미설치 시PROFILE_FAILED+ 설치 안내, 설치 후 1.19 GB.snap생성(1.2초) 확인. capture 진행 중 snapshot은PROFILE_IN_PROGRESS로 거부됨.editor launch→play→profile memory→stop→editor stop, 사람 개입 없음.라이브 검증 중 발견해 고친 것 2건: 미지원 카운터 제거, 게이트 메시지의 잘못된 CLI 문법(
package add <name>→package add --name <name>).Tests / docs
dotnet test986 passed / 0 failedscripts/check-unity-meta.sh통과 (신규.cs의.meta는 Unity가 생성한 것을 커밋)--checkup to date), README, CLAUDE.md, CHANGELOG 2벌, 스킬 SKILL.md 2벌 +references/profiling.md2벌(diff 0)🤖 Generated with Claude Code
https://claude.ai/code/session_01XPBXJjiKtZk6DqEScTpN5D