IntelliJ `AnAction` 클래스를 구현하거나 수정하고 `plugin.xml`에 등록하도록 안내합니다. 표시 이름과 설명은 메시지 번들에 두고, 필요하면 아이콘을 설정하며, 이벤트 코루틴 범위에서 중단 함수를 실행해 동기식 처리로 IDE가 멈추는 일을 방지합니다.
- IDE 메뉴에 새 동작 추가
- 동작 등록이나 아이콘 변경
- 동작 이름과 설명 정리
테스트에서 PyCodeInsightCounters로 Python 타입 추론 엔진의 작업량을 세고 PyPerfProbe로 작업 횟수, 메모리 할당, AST 로드와 시간을 비교합니다. 성능 변화나 회귀를 확인할 때 활용합니다.
Count Python code insight work in tests with PyCodeInsightCounters.
실행 점수 미검증
설치 방법 보기테스트에서 PyCodeInsightCounters를 사용해 Python 타입 추론 엔진이 수행하는 작업을 세는 방법을 안내합니다. 타입 조회, 캐시, 타입 일치 검사, 제어 흐름 구성 등의 카운터로 변경 전후의 작업량이나 입력 크기에 따른 증가를 비교할 수 있습니다. PyPerfProbe를 사용하면 시나리오별 처리 시간, 메모리 할당, AST 로드도 측정하고 PYPERF 행으로 보고할 수 있습니다. 경과 시간만 믿지 않고 안정적인 작업 횟수로 성능 회귀를 테스트하는 방법도 다룹니다.
타입 엔진 변경으로 불필요한 작업이 늘었는지 확인하거나 성능 문제를 회귀 테스트로 고정하려는 경우에 유용합니다. 코드 크기에 따른 작업량 증가를 비교하거나 하이라이팅 및 파일 편집 후의 시나리오를 측정할 때도 사용할 수 있습니다.
카운터는 기본적으로 꺼져 있습니다. countOnCurrentThread는 호출 스레드만 세며, 모든 스레드의 스냅샷 차이에는 IDE 백그라운드 작업도 포함됩니다. 일반 테스트 실행에서는 성능 테스트를 건너뜁니다.
이 소개문은 공개된 SKILL.md를 바탕으로 AI(OpenAI Codex)가 작성했습니다. 정확한 사양은 아래 원문을 확인하세요.
AI가 SKILL.md의 내용에서 주의가 필요한 작업과 도입 전제를 확인했습니다. 점수는 실제로 실행한 결과(실행 검증)만으로 매깁니다.
점수에는 넣지 않았습니다. 2026년 10월 28일 기준으로 AI(OpenAI Codex)가 판정했습니다. 참고용이므로 설치 전에 원문도 확인해 주세요.
설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.
PyCodeInsightCounters (python-psi-impl, package com.jetbrains.python.codeInsight) counts the work of the native
Python type engine. PyPerfProbe (community/python/testFramework, package com.intellij.python.community.testFramework.performance)
measures a scenario with these counters, the wall time, the allocations and the AST loads.
Use them to show that a change does less work, to show how the work grows with the input, or to pin a performance defect in a test. A work count does not flake like a time.
| Counter | Counts | Hook |
|---|---|---|
GET_TYPE_CALLS | each getType call | TypeEvalContextImpl.getType |
GET_TYPE_CACHE_HITS | the calls that the context cache answers | TypeEvalContextImpl.getType |
GET_TYPE_EVALUATIONS | the calls that evaluate a type | TypeEvalContextImpl.getType |
CONTEXTS_CONSTRUCTED | each type context, also the library and assumption contexts | TypeEvalContextImpl constructor |
CONTEXT_LOOKUP_MISSES | the context lookups that store a new context | TypeEvalContextCacheImpl |
ASSUME_TYPE_CALLS | the narrowing assumptions that create a context | TypeEvalContextImpl.assumeType |
MATCH_STEPS | the steps of the type match | PyTypeChecker.match |
OVERLOAD_CANDIDATES_CHECKED | the overload candidates that the argument types check | PyCallExpressionHelper.matchesByArgumentTypes |
CFG_BUILDS, CFG_INSTRUCTIONS | the control flow builds and their instructions | PyControlFlowBuilder.buildControlFlow |
A cache hit and an evaluation do not add up to the calls. The rest are library delegations and the requests that the recursion guard stops.
The counting is off by default. For the work of the calling thread only:
val counts = PyCodeInsightCounters.countOnCurrentThread { context.getType(expression) }
assertEquals(1L, counts.getValue(Counter.GET_TYPE_EVALUATIONS))
The highlighting passes run on other threads, so countOnCurrentThread does not see their work. For all threads, take
two snapshots:
PyCodeInsightCounters.enable(testRootDisposable)
val before = PyCodeInsightCounters.snapshot()
myFixture.doHighlighting()
val delta = PyCodeInsightCounters.snapshot() - before
assertTrue(delta[Counter.CFG_BUILDS] >= 1)
The delta also contains the background work of the IDE in that time. Assert an exact count only for the calling thread. Otherwise assert a bound or a ratio.
PyPerfProbe.Editor over the test fixture. FixtureEditor in PyNativeEngineCountersPerformanceTest is
an example.RecursionManager test checks and
sets the registry keys of PyPerfProbe.PINNED_REGISTRY to their IDE values.measure(scenario) { action } runs 3 warm-up attempts and 10 attempts. Before each attempt, setup runs.
The default setup is cold().measureEditorFile(name, inspections) measures a cold highlighting, a highlighting after a one-character edit,
and one inferAll pass.measureScaled(scenario) { action } uses fewer attempts when the first run takes more than 10 seconds.report(result). It prints PYPERF lines: the time quantiles, the allocations, the AST loads of the first
attempt, and each counter with its median, its range and the value of the first attempt.Mark the test class with @PerformanceUnitTest. The usual test runs skip it. tests.cmd runs it when you give its
fully qualified name.
The system property pyperf.out names a file that also gets the PYPERF lines. The system property
pyperf.astload.stacks=true prints the stack of the first three AST loads of each file.
cold() drops the PSI caches and the type contexts. The PSI, the stubs, the control flow and the soft caches stay.
So the counts of one scenario change between attempts. For a cold highlighting of pandas_examples.py, the range of
type.getType.evaluations is about 20 % of the median.range= value before you claim a difference.PyCodeInsightCounters.Counter with a stable dotted id, for example type.foo.calls.PyCodeInsightCounters.inc(Counter.FOO_CALLS) or add(counter, value). When the counting is
off, a call costs one volatile read. Put other work at the hook behind PyCodeInsightCounters.isEnabled.아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.
로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.
아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.
IntelliJ `AnAction` 클래스를 구현하거나 수정하고 `plugin.xml`에 등록하도록 안내합니다. 표시 이름과 설명은 메시지 번들에 두고, 필요하면 아이콘을 설정하며, 이벤트 코루틴 범위에서 중단 함수를 실행해 동기식 처리로 IDE가 멈추는 일을 방지합니다.
IntelliJ JPS 테스트 모듈을 Bazel로 옮기고 Bazel에서만 발생하는 실패를 조사하는 안내서입니다. 의존성, 플러그인, 테스트 데이터와 runfiles 문제를 확인하고 생성된 대상과 이전된 테스트를 검증합니다.
IntelliJ 프로젝트 규칙에 맞춰 Kotlin과 Java 코드를 작성하거나 검토합니다. 언어 선택, 서식, 봉인 타입, 스레드 주석, 제어 흐름 예외 처리를 확인합니다.
이 가이드는 IntelliJ 프로젝트의 변경 사항을 목적별로 나누고 프로젝트 형식에 맞는 커밋 메시지를 작성하도록 돕습니다. 티켓이 있으면 번호와 변경 설명을, 없으면 레이블과 하위 시스템명을 사용하며 필요에 따라 이유와 판단을 본문에 담습니다.
여러 Python 타입 검사기로 코드 조각이나 파일의 타입 추론과 오류 판정을 비교합니다. 도구별 결과, 실행 시간, 진단 내용을 Markdown 보고서로 모아 저장할 수 있습니다.
Compose Desktop 화면을 구성할 때 컴포저블은 렌더링을 맡고 프레젠터나 코디네이터는 앱 결정을 맡도록 구조를 정리합니다. 상태 소유권, Effect, 재사용 컴포넌트 API, 지연 목록 키, 애니메이션과 성능을 개별 UI 변경에 맞춰 살펴봅니다.