# ykcpython：让CPython跑得比实验性JIT更快

Original title: Adapting CPython for Yk

> Hacker News story 50466410 · language: zh · submitted 2026-11-12
> Web version: https://zeli.app/zh/story/50466410
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 79 · by [frostbyte7](<https://news.ycombinator.com/user?id=frostbyte7>) · 💬 6
[original](<https://tratt.net/laurie/blog/2026/adapting_cpython_for_yk.html>) · [HN discussion](<https://news.ycombinator.com/item?id=50466410>)

## Summary

今年早些时候，我发布了关于 yk 的文章，它能自动为 C 解释器添加 JIT 编译器。起初在 yklua 上取得了 2 倍的性能提升，但有人质疑这在大解释器上是否有效。于是我们重新审视了 CPython，经过约 4 天的工作加上半周的通用 yk 修复，成功将 yk 适配到 CPython 的 tier 2 解释器中，诞生了 ykcpython。在 AWFY 基准测试中，ykcpython 在 13 个测试里有 10 个跑赢了标准 CPython，更有 8 个测试超越了 CPython 自带的实验性 JIT。虽然 ykcpython 尚未达到生产就绪状态，但这次实验证明了只需不到 450 行代码，就能让成熟的解释器获得显著的性能飞跃。

## Key quote

> 我的观点是，基准测试的表现只是需要跨过的一个门槛，而非最终目标：一个在基准测试中表现良好的系统可能在现实世界中表现糟糕，但一个在基准测试中表现糟糕的系统几乎总是在现实世界中表现糟糕。

## HN discussion (6 comments)

### [jonathaneunice](<https://news.ycombinator.com/item?id=50474921>)

> 非常棒。我一直很喜欢 PyPy，把它当作让 Python 跑得更快的方案，但它直到今年九月才支持到 Python 3.12，而且目前仍处于 beta 阶段（https://pypy.org/posts/2026/10/pypy-v801-release.html）。这比 CPython 的 3.12 版本晚了大约三年。CPython 自身的 JIT 支持似乎时断时续，所以听到外部方案可能能分担一些压力的消息，真是令人振奋。

---

## Cite

- Page: https://zeli.app/zh/story/50466410
- Date: 2026-11-12
- Source: tratt.net (https://tratt.net/laurie/blog/2026/adapting_cpython_for_yk.html)
- Hacker News: https://news.ycombinator.com/item?id=50466410

## Other languages

- en: https://zeli.app/story/50466410 · markdown: https://zeli.app/story/50466410.md
- ja: https://zeli.app/ja/story/50466410 · markdown: https://zeli.app/ja/story/50466410.md
- ko: https://zeli.app/ko/story/50466410 · markdown: https://zeli.app/ko/story/50466410.md
- de: https://zeli.app/de/story/50466410 · markdown: https://zeli.app/de/story/50466410.md
- es: https://zeli.app/es/story/50466410 · markdown: https://zeli.app/es/story/50466410.md
- ru: https://zeli.app/ru/story/50466410 · markdown: https://zeli.app/ru/story/50466410.md
