performance-optimization
БесплатноБез исполняемых скриптовНе проверенOptimize performance for memory, CPU, network, and rendering. Use when improving FPS, reducing memory usage, or fixing performance bottlenecks.
от Sir-chawakorn★ 32 звезды на GitHubОб этом скилле
⚡ Performance Optimization Skill
Memory Optimization
Avoid Memory Leaks
// ❌ Bad - listener not removed
element.addEventListener('click', handler);
// ✅ Good - cleanup
const controller = new AbortController();
element.addEventListener('click', handler, { signal: controller.signal });
// Later: controller.abort();
Object Pooling
class FramePool {
constructor(size) {
this.pool = Array(size).fill(null).map(() => new ArrayBuffer(1024 * 1024));
this.available = [...this.pool];
}
acquire() {
return this.available.pop() || new ArrayBuffer(1024 * 1024);
}
release(buffer) {
this.available.push(buffer);
}
}
Network Optimization
Debounce Requests
function debounce(fn, delay) {
let timer;
return (...args) => {
clearTimeout(timer);
timer = setTimeout(() => fn(...args), delay);
};
}
const debouncedSearch = debounce(searchAPI, 300);
Batch Requests
class RequestBatcher {
constructor(batchFn, delay = 50) {
this.queue = [];
this.batchFn = batchFn;
this.delay = delay;
}
add(item) {
this.queue.push(item);
clearTimeout(this.timer);
this.timer = setTimeout(() => this.flush(), this.delay);
}
flush() {
if (this.queue.length > 0) {
this.batchFn([...this.queue]);
this.queue = [];
}
}
}
Rendering Optimization
RequestAnimationFrame
// ❌ Bad
setInterval(render, 16);
// ✅ Good
function animate() {
render();
requestAnimationFrame(animate);
}
requestAnimationFrame(animate);
Throttle FPS
let lastFrame = 0;
const targetFPS = 30;
const frameInterval = 1000 / targetFPS;
function animate(timestamp) {
if (timestamp - lastFrame >= frameInterval) {
render();
lastFrame = timestamp;
}
requestAnimationFrame(animate);
}
Image/Video Optimization
Compression
// Canvas to JPEG with quality
canvas.toBlob((blob) => {
sendFrame(blob);
}, 'image/jpeg', 0.5); // 50% quality
// Resize before send
const scale = 0.5;
ctx.drawImage(video, 0, 0, width * scale, height * scale);
Lazy Loading
<img loading="lazy" src="image.jpg">
Profiling Tools
| Tool | Use Case |
|---|---|
| Chrome DevTools → Performance | CPU, rendering |
| Chrome DevTools → Memory | Memory leaks |
| Lighthouse | Overall score |
| console.time() | Measure code blocks |
console.time('upload');
await uploadFile(file);
console.timeEnd('upload'); // upload: 1234ms
TitanMirror Performance
| Setting | Value | Impact |
|---|---|---|
| Resolution | 480p | -60% bandwidth |
| JPEG Quality | 50% | -50% size |
| Target FPS | 25 | Smooth enough |
| ImageReader Buffer | 5 | Prevent drops |
Установить performance-optimization в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл performance-optimization?
Optimize performance for memory, CPU, network, and rendering. Use when improving FPS, reducing memory usage, or fixing performance bottlenecks.
Как установить скилл performance-optimization?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл performance-optimization запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic