<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>性能优化 on Jiayun's Blog</title><link>https://xiejiayun.github.io/tags/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/</link><description>Recent content in 性能优化 on Jiayun's Blog</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Fri, 15 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://xiejiayun.github.io/tags/%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96/index.xml" rel="self" type="application/rss+xml"/><item><title>【好文共赏】把 Swift 推到 1.1 Tflop/s：Matt Gallagher 用十种实现，在 M3 Max 上手写 LLM 训练，把矩阵乘法跑出 382 倍提升</title><link>https://xiejiayun.github.io/post/good-read-matt-gallagher-swift-llm-matmul/</link><pubDate>Fri, 15 May 2026 00:00:00 +0000</pubDate><guid>https://xiejiayun.github.io/post/good-read-matt-gallagher-swift-llm-matmul/</guid><description>&lt;blockquote>
&lt;p>📌 &lt;strong>好文共赏 · Editor&amp;rsquo;s Pick&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>&lt;strong>原文&lt;/strong>：&lt;a href="https://www.cocoawithlove.com/blog/matrix-multiplications-swift.html">Training an LLM in Swift, Part 1: Taking matrix multiplication from Gflop/s to Tflop/s&lt;/a>&lt;/li>
&lt;li>&lt;strong>作者&lt;/strong>：Matt Gallagher（&lt;a href="https://www.cocoawithlove.com/">Cocoa with Love&lt;/a> 主理人，iOS/macOS 资深独立开发者）&lt;/li>
&lt;li>&lt;strong>发布时间&lt;/strong>：2026 年 4 月 18 日&lt;/li>
&lt;li>&lt;strong>阅读时长&lt;/strong>：约 35 分钟（含代码与汇编片段）&lt;/li>
&lt;li>&lt;strong>多模评分&lt;/strong>：Opus 9.0 / Sonnet 8.8 / Gemini 8.7 — &lt;strong>综合 8.85 / 10&lt;/strong>&lt;/li>
&lt;li>&lt;strong>一句话推荐&lt;/strong>：一次极少有人能写出来的&amp;quot;全栈&amp;quot;性能讲座——不是 PyTorch 算子优化的高谈阔论，而是一个独立开发者用十个版本、上百行汇编、若干被 Apple 刻意藏起来的指令，把 Swift 训练 GPT-2 的速度推到比纯 C 快 30 倍、比单线程 OpenMP 快 30 倍、最终冲过 1 Tflop/s 的门槛。&lt;/li>
&lt;/ul>&lt;/blockquote>
&lt;h2 id="一为什么值得读">一、为什么值得读&lt;/h2>
&lt;p>这篇文章在 Hacker News 上拿到 260+ 分，但和大多数 HN 头条不同的是：它不是观点文，不是公司公告，也不是市场分析——它是一份&lt;strong>可复现、可量化、可单步演进&lt;/strong>的工程笔记。Matt Gallagher 不是在告诉你&amp;quot;Apple Silicon 多厉害&amp;quot;，而是把同一份 &lt;code>matmul_forward&lt;/code>（GPT-2 124M 模型里那条贯穿前向反向的矩阵乘法）写了十遍，每次只改一个变量，每次都给出 tokens/s 和训练迭代/s 的实测，每次都贴出对应的 ARM64 汇编片段，让读者亲眼看到 Swift 编译器做了什么、漏了什么、需要被怎样&amp;quot;哄&amp;quot;才能吐出和 C 同样紧凑的指令流。&lt;/p></description></item><item><title>谁还在用 jemalloc？2026 年内存分配器的文艺复兴</title><link>https://xiejiayun.github.io/post/jemalloc-2026-survey-allocator-renaissance/</link><pubDate>Thu, 07 May 2026 00:00:00 +0000</pubDate><guid>https://xiejiayun.github.io/post/jemalloc-2026-survey-allocator-renaissance/</guid><description>&lt;h2 id="一个被忽视的性能杠杆">一个被忽视的性能杠杆&lt;/h2>
&lt;p>在大多数程序员的认知里，内存分配器是一个「透明」的存在。你调用 &lt;code>malloc&lt;/code>，系统给你一块内存；你调用 &lt;code>free&lt;/code>，系统把它收回去。就这么简单。&lt;/p>
&lt;p>但如果你运营过一个日均处理数十亿请求的数据库、一个需要在 64 核机器上榨干每一纳秒的存储引擎、或者一个在移动设备上要把 RSS 压到极致的浏览器——你就会知道，内存分配器是整个系统里最隐蔽、却也最有杠杆效应的性能旋钮之一。&lt;/p></description></item><item><title>Python 3.15的JIT革命与Rust入侵：编程语言进化的双螺旋</title><link>https://xiejiayun.github.io/post/python-315-jit-rust-cpython-evolution/</link><pubDate>Fri, 24 Apr 2026 00:00:00 +0000</pubDate><guid>https://xiejiayun.github.io/post/python-315-jit-rust-cpython-evolution/</guid><description>&lt;p>Python社区在2026年4月迎来了两个看似独立实则深度关联的里程碑：Python 3.15的JIT编译器终于&amp;quot;回到正轨&amp;quot;，以及Rust for CPython项目发布了最新进展报告。这两条线索编织在一起，勾勒出的是编程语言演进的一个根本性转向：&lt;strong>动态语言的性能天花板正在被系统级语言从底层击穿&lt;/strong>。&lt;/p></description></item></channel></rss>