hello-perf

GitHub

提供全栈性能优化规范,涵盖数据库查询调优、缓存策略、前端渲染优化及算法并发最佳实践。用于指导高性能代码编写与审查,避免常见性能陷阱。

skills/hello-perf/SKILL.md hellowind777/helloagents

Trigger Scenarios

需要优化数据库查询或解决N+1问题 实现缓存策略或处理大数据集分页 优化前端加载速度或列表渲染性能 重构高复杂度算法或并发逻辑

Install

npx skills add hellowind777/helloagents --skill hello-perf -g -y
More Options

Use without installing

npx skills use hellowind777/helloagents@hello-perf

指定 Agent (Claude Code)

npx skills add hellowind777/helloagents --skill hello-perf -a claude-code -g -y

安装 repo 全部 skill

npx skills add hellowind777/helloagents --all -g -y

预览 repo 内 skill

npx skills add hellowind777/helloagents --list

SKILL.md

Frontmatter
{
    "name": "hello-perf",
    "description": "优化性能、处理数据库查询、实现缓存、懒加载、分页、打包优化,或代码涉及大数据集循环、并发操作、内存管理时使用。"
}

性能相关代码必须遵循以下规范。

编码前

先定位性能瓶颈(I/O / 计算 / 内存),再写代码。

查询优化

  • 禁止 N+1 查询:使用 JOIN、批量加载、dataloader
  • 大数据集必须分页,不一次加载全部
  • 数据库索引覆盖常用查询条件
  • 只查需要的字段(SELECT 具体列,不用 SELECT *)

缓存策略

  • 读多写少的数据 → 缓存(内存/Redis)
  • 设置合理的 TTL
  • 缓存失效策略:写时失效 > 定时过期
  • 防止缓存穿透(空值缓存)和雪崩(随机 TTL)

前端性能

  • 代码分割 + 路由级懒加载
  • 图片:WebP/AVIF、懒加载、srcset 响应式
  • 声明 width/height 或 aspect-ratio 防止布局偏移
  • 关键 CSS 内联,非关键 CSS 异步加载
  • 50+ 项列表使用虚拟滚动

算法与并发

  • 注意时间复杂度,禁止嵌套循环处理大数据集(O(n²)+)
  • Map/Set 查找 O(1) vs Array.includes O(n)
  • 批量操作优于逐条操作
  • 高频事件(scroll/resize/input)使用 debounce/throttle

交付检查

  • 无 N+1 查询
  • 列表接口有分页
  • 图片已优化(格式/懒加载/尺寸声明)
  • 无嵌套循环处理大数据集

Version History

  • 79c0b48 Current 2026-08-20 08:25

Same Skill Collection

skills/commands/auto/SKILL.md
skills/commands/loop/SKILL.md
skills/hello-api/SKILL.md
skills/hello-data/SKILL.md
skills/hello-errors/SKILL.md
skills/hello-security/SKILL.md
skills/hello-test/SKILL.md
skills/hello-ui/SKILL.md
skills/hello-write/SKILL.md
skills/_meta/SKILL.md
skills/commands/ask/SKILL.md
skills/commands/clean/SKILL.md
skills/commands/commit/SKILL.md
skills/commands/help/SKILL.md
skills/commands/init/SKILL.md
skills/commands/plan/SKILL.md
skills/commands/prd/SKILL.md
skills/commands/qa/SKILL.md
skills/commands/test/SKILL.md
skills/hello-arch/SKILL.md
skills/hello-debug/SKILL.md
skills/hello-reflect/SKILL.md
skills/hello-subagent/SKILL.md
skills/helloagents/SKILL.md
skills/qa-review/SKILL.md

Metadata

Files
0
Version
79c0b48
Hash
d19d42ff
Indexed
2026-08-20 08:25

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-24 22:32
浙ICP备14020137号-1 $방문자$