<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>Ember Moth</title><description>Ember Moth 的个人博客 — 网络协议、Rust、Go、安全研究与随笔。</description><link>https://www.embermoth.blog/</link><language>zh-CN</language><item><title>代理节点端热路径的零分配改造：原则、五个模式与实测</title><link>https://www.embermoth.blog/posts/proxy-node-hot-path-zero-allocation/</link><guid isPermaLink="true">https://www.embermoth.blog/posts/proxy-node-hot-path-zero-allocation/</guid><description>代理节点端的热路径是&quot;每秒几十万次的小操作&quot;：封一帧、加密一块、排队一个上传分片、发一个 UDP 报文。这类路径上每次操作多一次堆分配，单看 ns/op 几乎没有变化，但会以 GC assist、堆扫描和尾延迟抖动的形式在高负载下集体兑现。</description><pubDate>Sun, 27 Sep 2026 07:00:00 GMT</pubDate><category>golang</category><category>performance</category><category>zero-allocation</category><category>gc</category><category>sync-pool</category><category>backpressure</category><category>proxy</category><category>benchmark</category><author>ember_moth@proton.me (Ember Moth)</author></item><item><title>让路由查询与规则数无关：代理路由索引的一次重新设计</title><link>https://www.embermoth.blog/posts/routing-index-rule-count-independent-lookup/</link><guid isPermaLink="true">https://www.embermoth.blog/posts/routing-index-rule-count-independent-lookup/</guid><description>代理软件的路由规则是一张有序表：逐条检查，第一条命中的规则决定出口。这个语义天然导致&quot;规则越多、未命中越慢&quot;，因为一个不命中任何规则的请求要把整张表扫完，而带地理类别的规则每条都是几万个域名或网段。</description><pubDate>Sun, 27 Sep 2026 02:00:00 GMT</pubDate><category>routing</category><category>index</category><category>algorithm</category><category>data-structure</category><category>hash-table</category><category>aho-corasick</category><category>trie</category><category>performance</category><category>proxy</category><author>ember_moth@proton.me (Ember Moth)</author></item><item><title>用 smoltcp 做 TUN 代理的用户态栈：我们踩过的六个坑</title><link>https://www.embermoth.blog/posts/smoltcp-userspace-stack-six-pitfalls/</link><guid isPermaLink="true">https://www.embermoth.blog/posts/smoltcp-userspace-stack-six-pitfalls/</guid><description>上一篇讲了移动端为什么把 TCP 交还给内核。桌面端我们仍然用 smoltcp 跑用户态 TCP 栈，因为桌面没有 Extension 那样的内存墙，也不值得为省内存让每个载荷多穿一次 TUN。</description><pubDate>Sat, 26 Sep 2026 13:00:00 GMT</pubDate><category>rust</category><category>smoltcp</category><category>tun</category><category>tcp</category><category>netstack</category><category>tokio</category><category>concurrency</category><category>clash-rs</category><category>performance</category><author>ember_moth@proton.me (Ember Moth)</author></item><item><title>把 TCP 交还给内核：TUN 代理里的 system netstack 设计与实测</title><link>https://www.embermoth.blog/posts/system-netstack-kernel-tcp-for-tun/</link><guid isPermaLink="true">https://www.embermoth.blog/posts/system-netstack-kernel-tcp-for-tun/</guid><description>移动端隧道进程的内存墙让用户态 TCP 栈（smoltcp）成了负担：每条连接要背几百 KiB 的固定缓冲，还要自己处理重传、拥塞和窗口。system netstack 换了一条路：不实现 TCP，而是把 TUN 里读到的 TCP 包原地做源 NAT，改写后写回 TUN……</description><pubDate>Sat, 26 Sep 2026 07:30:00 GMT</pubDate><category>rust</category><category>tun</category><category>tcp</category><category>nat</category><category>smoltcp</category><category>clash-rs</category><category>network-extension</category><category>ios</category><category>android</category><category>performance</category><author>ember_moth@proton.me (Ember Moth)</author></item><item><title>为世界上所有的美好而战</title><link>https://www.embermoth.blog/posts/for-all-that-is-beautiful/</link><guid isPermaLink="true">https://www.embermoth.blog/posts/for-all-that-is-beautiful/</guid><description>关于这句签名，以及我为什么叫自己 Ember Moth。</description><pubDate>Sat, 15 Aug 2026 00:00:00 GMT</pubDate><category>随笔</category><author>ember_moth@proton.me (Ember Moth)</author></item><item><title>从 Gin 迁移到 Hertz：一次渐进式重构实战</title><link>https://www.embermoth.blog/posts/ppanel-gin-to-hertz-migration/</link><guid isPermaLink="true">https://www.embermoth.blog/posts/ppanel-gin-to-hertz-migration/</guid><description>这次迁移不是“把 import 从 gin 改成 hertz”这么简单，而是一次分层完成的渐进式重构：先抽离 transport 层，再做 Gin 兼容层，最后把热点路由和关键中间件原生化到 Hertz。</description><pubDate>Thu, 21 May 2026 06:15:00 GMT</pubDate><category>ppanel</category><category>golang</category><category>gin</category><category>hertz</category><category>backend</category><category>performance</category><author>ember_moth@proton.me (Ember Moth)</author></item><item><title>从MySQL Only到PostgreSQL+MySQL：一次从驱动抽象到 SQL 兼容的完整改造</title><link>https://www.embermoth.blog/posts/ppanel-postgresql-support/</link><guid isPermaLink="true">https://www.embermoth.blog/posts/ppanel-postgresql-support/</guid><description>为已有项目新增第二种数据库支持，工作量远大于&quot;加个驱动依赖&quot;。 本文记录 ppanel-server 从 MySQL-only 到同时支持 MySQL + PostgreSQL 的完整改造：重构配置抽象层、拆分两套迁移 DDL、修复 model 层 20+ 个 MySQL 专属写法、顺带优化搜索索引。</description><pubDate>Tue, 19 May 2026 09:23:00 GMT</pubDate><category>ppanel</category><category>golang</category><category>postgresql</category><category>gorm</category><category>database</category><author>ember_moth@proton.me (Ember Moth)</author></item></channel></rss>