[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EKFKDKC79FTPA6XG2WFQ2V":3,"skill-same:01M7EKFKDKC79FTPA6XG2WFQ2V":72},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":13,"repositoryHtmlUrl":25,"repositoryHomepageUrl":6,"ownerHtmlUrl":26,"ownerBlogUrl":27,"ownerDescription":28,"updatedAt":29,"install":30,"resources":43},"01M7EKFKDKC79FTPA6XG2WFQ2V","performance-native",null,"raillen\u002Fdaisy-code-editor","raillen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F50306048?v=4","01M7EKBDVVBSPF21PBPVJYMNYR","Raillen Santos","01M7EKBDWD12A1K9N9Y638FGX9",0,"MIT","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# Native Performance Optimization\n\n## Purpose\nProfile and optimize native CPU, GPU, and memory performance: cycle-level hotspots, cache-miss behavior, allocation churn, data-layout efficiency, and GPU pipeline stalls, with every claim backed by profiler captures before and after.\n\n## Use when\n- Diagnosing frame-time spikes, hitch budgets, or p99 latency regressions in native code (C, C++, Rust, Zig).\n- Reducing L1\u002FL2 cache misses, TLB pressure, branch mispredictions, or allocator contention.\n- Optimizing memory layout (AoS to SoA), SIMD utilization, or multithreaded job-system throughput.\n- Cutting GPU cost: draw calls, overdraw, pipeline state changes, or VRAM bandwidth.\n\n## Do not use when\n- Tuning browser asset caching or web vitals without native profiling (use `performance-web`).\n- Reviewing cache-invalidation topologies or distributed caching layers (use `caching`).\n- Fixing logical correctness bugs that merely look slow; profile first, and if the profile is flat, fix the algorithm choice elsewhere.\n\n## Required context\n- Performance budget: frame-time target (e.g., 16.6 ms at 60 fps with 2 ms hitch ceiling), p50\u002Fp99 latency SLAs, memory ceiling (e.g., 512 MB RSS on console profile).\n- Reproducible workload: benchmark scene, trace capture, or load script that triggers the regression deterministically.\n- Build profile under test: compiler, optimization flags (e.g., clang 18 `-O2 -fno-omit-frame-pointer`), LTO\u002FPGO status, target microarchitecture (e.g., x86-64-v3, Apple M2).\n- Profiler access: `perf`, Tracy, Superluminal, VTune, RenderDoc, or NSight availability on the target machine.\n\n## Procedure\n1. **Reproduce under the profiler**: Capture a 30-second `perf record -g -F 997` (or Tracy frame trace) of the exact regressing workload; record baseline: p50 frame 14.2 ms, p99 frame 21.8 ms, IPC 1.1, L1-D miss 6.4%.\n2. **Apply top-down analysis**: Classify cycles into retiring, bad speculation, frontend-bound, backend-bound (`perf stat -e cycles,instructions,cache-misses,branch-misses`). Attack the largest category first; ignore any function below 2% of total cycles.\n3. **Fix data layout before algorithms**: Convert hot AoS arrays to SoA, shrink hot structs below 64-byte cache lines, replace pointer-chasing (`std::map` node hops) with flat arrays; re-measure L1-D miss rate, targeting below 3%.\n4. **Cut allocation churn**: Replace per-frame `malloc`\u002F`new` in hot loops with arenas, pools, or bump allocators; verify with heaptrack that steady-state frame allocations drop to zero and RSS stays flat across 10,000 frames.\n5. **Parallelize and vectorize deliberately**: Move independent work to the job system with cache-line-padded job structs (no false sharing), then auto-vectorize inner loops (`-Rpass=loop-vectorize` must name the loop); confirm scaling efficiency above 70% from 4 to 8 threads.\n6. **Verify GPU and persist evidence**: Capture RenderDoc frame (draw calls, state changes, overdraw heatmap); assert the fix holds on the slowest declared target, store before\u002Fafter captures, and run `scripts\u002Fverify.sh` to confirm artifact completeness.\n\n## Decision rules\n- **No optimization without a profile**: Changes justified by intuition alone are rejected; every hotspot fix cites a capture with symbol, cycles share, and miss counters.\n- **Measure on the slowest target**: Desktop-only measurements never close a console or mobile performance gate.\n- **Correctness gates stay green**: `-fsanitize=address,undefined` plus the full test suite must pass; a 5% speedup that introduces UB is a regression.\n- **Hitch ceiling is absolute**: Any single frame above the 2 ms over-budget hitch limit fails, even if averages look healthy.\n- **Memory growth must be flat**: Steady-state RSS growth above 1 MB per 10,000 frames blocks the change until the leak or churn source is fixed.\n\n## Evidence required\n- Before\u002Fafter profiler captures (perf.data, Tracy trace, or RenderDoc capture) with p50\u002Fp99 frame times and IPC.\n- `perf stat` counter deltas: cycles, instructions, cache-misses, branch-misses, page faults.\n- heaptrack or sanitizer logs proving zero steady-state allocation churn and no leaks.\n- Completed `templates\u002Fperformance-native-spec.md` with budget table and verdicts.\n- Passing execution log from `scripts\u002Fverify.sh`.\n\n## Output contract\n- Performance specification document with budgets, captures, and per-fix deltas.\n- Optimized implementation with layout, allocation, and threading changes isolated per commit.\n- Benchmark harness addition so CI tracks p99 frame time on every merge.\n\n## Stop conditions\n- p99 frame time within budget on the slowest declared target with hitch ceiling held.\n- L1-D miss rate below 3% on hot loops and steady-state allocation churn at zero.\n- Token budget exhausted.\n- Blocked on external dependency.\n\n## Escalation rules\n- Escalate to the lead architect if the budget requires algorithmic redesign (e.g., O(n²) broadphase must become spatial hash) rather than tuning.\n- Escalate to platform owners if the bottleneck is driver, OS scheduler, or hardware errata outside application control.\n- Escalate immediately if profiling reveals memory-safety violations, data races, or thermal throttling that invalidates measurements.\n",{},"main","2e465213b972294984c8c9515a47f811e4b358da",".agents\u002Fskills\u002Fperformance-native","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor","https:\u002F\u002Fgithub.com\u002Fraillen","https:\u002F\u002Fraillen.com","\u003C\u003CMarketing & IT>>\r\n\r\n@poppy-team\r\n@wasd-lat ","2026-10-16 09:17:52",{"source":7,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add raillen\u002Fdaisy-code-editor --skill performance-native",{"tool":36,"command":37},"bunx","bunx skills add raillen\u002Fdaisy-code-editor --skill performance-native",{"tool":39,"command":40},"pnpm","pnpm dlx skills add raillen\u002Fdaisy-code-editor --skill performance-native","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002FSKILL.md",true,[44,50,54,58,64,68],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"checks\u002Fperformance-native-checklist.md","REFERENCE","参考文档",2361,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002Fchecks\u002Fperformance-native-checklist.md",{"path":51,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":52,"sourceHtmlUrl":53},"manifest.json",2240,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002Fmanifest.json",{"path":55,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":56,"sourceHtmlUrl":57},"references\u002Fperformance-native-guide.md",3787,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002Freferences\u002Fperformance-native-guide.md",{"path":59,"resourceType":60,"resourceTypeDesc":61,"sizeBytes":62,"sourceHtmlUrl":63},"scripts\u002Fverify.sh","SCRIPT","脚本",4062,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002Fscripts\u002Fverify.sh",{"path":65,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":66,"sourceHtmlUrl":67},"templates\u002Fperformance-native-spec.md",2147,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002Ftemplates\u002Fperformance-native-spec.md",{"path":69,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":70,"sourceHtmlUrl":71},"templates\u002Fperformance-native-template.md",840,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fperformance-native\u002Ftemplates\u002Fperformance-native-template.md",[73,79,85,92,99,106],{"skillNo":74,"name":75,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":18},"01M7EKQYSDAX3SGSCRF873Z8E2","zoom-reflow","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M7EKQX0MWJNQD482GGZPGES4","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":18},"01M7EKQS57FS6JYE6KWW6X5ADJ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":18},"01M7EKQMFR7651NVH100P5781Z","ui-implementation","Component-driven UI implementation, multi-state matrix (default, hover, focus-visible, active, disabled, loading, empty, error), DTCG design tokens, responsive layout contracts, and accessibility tree mapping.","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":18},"01M7EKQG3NVX6DPCYS6Q4PA71V","tui-editor-engine","Text buffer and editing semantics for a terminal code editor — index conversion, transaction-first editing, multi-cursor invariants, undo grouping, and large-file behaviour.","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":18},"01M7EKQEJ993JGC72FE2KFY3ZZ","tree-sitter-context-indexing","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]