optimize-performance
3
总安装量
3
周安装量
#60380
全站排名
安装命令
npx skills add https://github.com/iurygdeoliveira/labsis-kit --skill optimize-performance
Agent 安装分布
claude-code
2
windsurf
1
trae
1
opencode
1
codex
1
antigravity
1
Skill 文档
Performance Optimizer Skill
Use this skill when the user reports “slow pages” or asks to “optimize” code.
Checklist
1. Database (The Usual Suspect)
- N+1 Detection: Look for loops calling relationships.
- Bad:
@foreach ($users as $user) {{ $user->posts->count() }} @endforeach - Fix:
User::withCount('posts')->get()
- Bad:
- Indexes: Ensure searching columns (slugs, foreign keys, status) are indexed.
2. Livewire / Filament
- Computed Properties: Use
#[Computed]for expensive calculations that don’t need to run on every dehydrate. - Lazy Loading: Use
lazy()on heavy components.
#[Computed]
public function heavyData()
{
return ...;
}
3. Caching
- Cache Facade:
Cache::remember('key', 60, fn() => ...)for unrelated data. - Model Caching: If generic, use the model’s
bootedmethod to clear cache on updates.
4. Cloudflare / HTTP
- Check headers for
Cache-Control.