<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cache on Jasper</title><link>https://jasper-aa64.github.io/zh/tags/cache/</link><description>Recent content in Cache on Jasper</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Tue, 20 Oct 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://jasper-aa64.github.io/zh/tags/cache/index.xml" rel="self" type="application/rss+xml"/><item><title>低时延交易 —— 缓存案例：一次行情重算 64 个期权</title><link>https://jasper-aa64.github.io/zh/posts/low-latency-cache-case-study/</link><pubDate>Tue, 20 Oct 2026 00:00:00 +0000</pubDate><guid>https://jasper-aa64.github.io/zh/posts/low-latency-cache-case-study/</guid><description>一条行情要碰 140 条缓存行，时间大多花在等它们。四步改的都不是计算，是数据什么时候到、到哪一层、在谁手里：让缺失同时在路上，提前要下一批，交出读一次就没用的行，跨核交接时少读一次，把要给对面读的行先放进 L3。</description></item><item><title>交易系统笔记 #6：内存对齐、布局与缓存和 DRAM 的几何</title><link>https://jasper-aa64.github.io/zh/posts/alignment-layout-cache-dram-geometry/</link><pubDate>Sun, 04 Oct 2026 00:00:00 +0000</pubDate><guid>https://jasper-aa64.github.io/zh/posts/alignment-layout-cache-dram-geometry/</guid><description>访问从来不按字节付钱，按缓存行付；地址决定了碰哪几条行、这些行争哪个缓存组、住在哪个 DRAM 通道和 bank。第一部分讲对齐：为什么按 8 对齐的 double 不会跨行、填充为什么是为了数组、alignas 写在类型上和成员上的区别、堆上怎么拿 64 和 2 MiB 对齐。第二部分讲布局：一次访问碰几条行，AoS 还是 SoA，去规范化砍掉的是依赖链。第三部分进到硬件：L1 用地址的 bit 6–11 选组，相差 4 KiB 的数据不管缓存多空都在抢 8 个格子（M1 上实测）；DRAM 一个 bank 只有一个行缓冲，命中 14 ns、冲突 41 ns；按列遍历慢是五层叠加；刷新带来软件消不掉的 P99；热行步长和通道数互质，通道才均衡。</description></item></channel></rss>