From 8e1d3095a2c1aba7a4672fe2d8ebca87c7abcda3 Mon Sep 17 00:00:00 2001 From: yetone Date: Sat, 14 Nov 2026 15:03:13 +0800 Subject: [PATCH] lessons: 11-14 yaml.v3 vendored for an allocation cut (0caa09b3d) The review diffed third_party/yaml.v3 against gopkg.in/yaml.v3 v3.0.1 after gofmt: only the 7-line emitter change differs. Docs only; no code run. --- LESSONS.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/LESSONS.md b/LESSONS.md index 100818d83..e6863c228 100644 --- a/LESSONS.md +++ b/LESSONS.md @@ -1406,6 +1406,15 @@ each one. dc85a7ca5 then added +12 for AIGoCode's logo in pngIcons, and 27c998aba +491 for costs in each provider's currency, nothing moved out either: three raises by 13:00, +570 bytes. + - A library vendored for an allocation cut: 0caa09b3d copied + yaml.v3 v3.0.1 into third_party (11,400 lines, go.mod replace) for + a 7-line emitter change. The review diffed it against the gofmt'd + upstream: only those 7 lines differ. Footprint moved 59 -> 58 MB, + within run-to-run spread; the gain is ~24 MB of short-lived + allocations on a catalog change. The cost stays: an upstream fix + reaches magpie only when someone copies it over by hand + (MAGPIE.md says how), and the full suite wasn't run. A vendored + fork names its measured gain against that cost, and runs the suite. - Done right: f1f34d624 met the budget with no raise, moving keysTag into keyrates.js, which is loaded exactly when a model can have a key tag.