# Python 3.15 신규 샘플링 프로파일러 Tachyon 소개

> Clean Markdown view of GeekNews topic #29673. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=29673](https://news.hada.io/topic?id=29673)
- GeekNews Markdown: [https://news.hada.io/topic/29673.md](https://news.hada.io/topic/29673.md)
- Type: news
- Author: [darjeeling](https://news.hada.io/@darjeeling)
- Published: 2026-05-20T06:37:58+09:00
- Updated: 2026-05-20T06:37:58+09:00
- Original source: [blog.changs.co.uk](https://blog.changs.co.uk/benchmarking-free-threading-performance-with-tachyon.html)
- Points: 1
- Comments: 0

## Topic Body

Python 3.15에 도입된 샘플링 프로파일러 Tachyon으로 멀티스레딩 병목을 시각화하고 OOP 추상화의 성능 함정을 잡아낸 사례소개  
  
  
##### Tachyon이란?  
Python 3.15에 표준 라이브러리로 추가되는 샘플링 기반 프로파일러.  
기존 프로파일러들이 외면했던 **프리스레딩(GIL-free) 환경을 네이티브로 지원**하는 것이 핵심.  
  
##### 주요 특징  
- 샘플링 방식으로 **낮은 오버헤드**  
- **모든 스레드 동시 프로파일링** 지원 (`-a` 옵션)  
- 실행 중인 프로세스에 **원격 연결(attach)** 가능  
- 플레임그래프 등 **다양한 출력 포맷** 지원  
- **async 인식** — asyncio 프로그램에도 적용 가능  
  
##### 실행 방법  
```bash  
sudo -E uv run -p 3.15.0a6t python -m profiling.sampling run \  
  -a --flamegraph -o profile.html -r 20khz your_script.py  
# -a       : 메인 스레드 외 모든 스레드 프로파일링  
# -r 20khz : 초당 20,000회 샘플링 (정밀도 조절 가능)  
# 결과물   : 플레임그래프 HTML — 빨간 컬럼이 핫패스  
```  
  
##### 실제 적용 사례 — 프리스레딩 병목 탐지  
  
**최적화 전** — `__getitem__`을 통한 Grid 접근이 전체 실행시간의 **75%** 차지  
  
<https://blog.changs.co.uk/images/unoptimised-bench.png>  
  
**최적화 후** — 내부 tuple 직접 접근으로 변경 후 **5.32%로 감소**  
  
<https://blog.changs.co.uk/images/optimised-bench.png>  
  
##### 왜 중요한가  
- 지금까지 프리스레딩 성능 문제는 "감으로 찾는" 수밖에 없었음  
- Tachyon은 **어디서 스레드가 막히는지 시각적으로** 보여주는 첫 번째 공식 도구  
- 일반 Python 개발자도 프리스레딩 성능을 직접 측정하고 개선할 수 있는 길이 열림

## Comments



_No public comments on this page._
