rust-memory-layout
Skill0 starsChanged 44 days agoNo licenceView on GitHub
Rust で「長寿命かつ挿入後は不変」なデータ (キャッシュエントリ、in-memory テーブル、解析済みレコード、DO/Worker の常駐 state) を大量に保持するときのメモリレイアウト最適化チェックリスト。Cloudflare 1.1.1.1 の DNS キャッシュ最適化 (エントリ 953→420 B、-56%、しかも insert +43% / lookup -19%) から抽出した 5 手法と測り方。(1) 不変なら `Vec<T>`/`String` を `Box<[T]>`/`Box<str>` に (capacity 8 B + 余剰 heap を捨てる)、(2) 並列する複数リストは 1 本 + `u16` オフセット、bool 群は bitflags でパディングも削る、(3) 大半が同じ値のフィールドは `Option<Box<_>>` で省略し読み出し時に復元、(4) enum は最大 variant のサイズになる → 大きく稀な variant だけ `Box` する、(5) 最終形は wire/serialized 形式の `Box<[u8]>` で連続保持 (allocator size class と CPU キャッシュ局所性の両方を解く)。計測は `size_of::<T>()` + `GlobalAlloc` ラッパ + resident memory。トリガー: 「メモリ使用量を減らしたい」「RSS が増え続ける」「struct のサイズ」「size_of」「enum が大きい」「Box<[T]>」「Vec の capacity」「パディング」「repr」「jemalloc」「キャッシュに何百万件持つ」「HashMap の値が重い」「DO の storage/メモリ上限」「Cloud Run の instance memory 削減」等、Rust の常駐データ量が問題になる場面で必ず参照。
1 other project uses a version of this.
Adopted by
Most recently taken up by
- jscott3201/yet-more-skillstheir own version, first seen Sep 7, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- jscott3201/yet-more-skills★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository88 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- alcoholchecker-deploySkill
- alc-workers-opsSkill
- auth-client-consumeSkill
- auto-merge-401Skill
- auto-merge-deploy-raceSkill
- branch-issue-linkingSkill
- bun-browser-verifySkill
- cdp-agentSkill
- cdp-browserSkill
- cdp-pairSkill
- cf-access-staging-public-pathsSkill
- cf-builds-trigger-dns-lossSkill
- check-issueSkill
- ci-cache-patternsSkill
- ci-initSkill
- claude-in-chromeSkill
- claude-md-auditSkill
- ccow-network-egressSkill
- durable-object-workerSkill
- gh-actions-phantom-permissionSkill
- gmail-mcpSkill
- ippoan-infra-mapSkill
- large-codebase-setupSkill
- local-first-testingSkill
- claude-skills-mapSkill
- open-multirepoSkill
- plan-with-fableSkill
- plan-with-opusSkill
- post-pr-verifySkill
- review-with-fableSkill
- review-with-opusSkill
- subagent-orchestrationSkill
- ui-previewSkill
- code-searchSkill
- copy-paste-friendlySkill
- cores3-crash-triageSkill
- coverage-checkSkill
- coverage-test-patternsSkill
- create-cr-mcpSkill
- create-previewSkill
- cross-repo-symbol-indexSkill
- dev-login-local-verifySkill
- egov-apiSkill
- egov-specSkill
- eml-readSkill
- gcp-cloud-run-routing-trapsSkill
- gcp-pam-opsSkill
- gh-actions-cross-org-secretsSkill
- gh-actions-liveSkill
- identity-proxy-rolloutSkill
- ippoan-android-baselineSkill
- ippoan-lib-catalogSkill
- kintai-opsSkill
- knowledgeSkill
- mcp-user-setupSkill
- memory-pruneSkill
- migrate-testSkill
- next-sessionSkill
- npm-supply-chainSkill
- The first 60 shown.
The file
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

