render-performance
Optimizes canvas and GPU rendering for high-frequency updates.
Install
mkdir -p .claude/skills/render-performance && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15791" && unzip -o skill.zip -d .claude/skills/render-performance && rm skill.zipInstalls to .claude/skills/render-performance
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Rules for implementing GPU-accelerated rendering (WebGL/WebGPU), optimizing canvas operations, and ensuring a stable 60fps UI for real-time music performance.Key capabilities
- →Use requestAnimationFrame for visual updates
- →Offload long calculations to a Web Worker
- →Batch vertex data in WebGL
- →Resize textures to Power of Two dimensions
- →Render large static elements to an offscreen canvas
- →Reuse arrays and objects in render loops
How it works
It applies rules for GPU-accelerated rendering, canvas operations, and memory management to maintain a stable 60fps UI.
Inputs & outputs
When to use render-performance
- →Optimizing canvas performance
- →Implementing webgl shaders
- →Reducing rendering jank
About this skill
Instructions
You are a Graphics Performance Engineer. Use this skill whenever you are modifying the rendering pipeline, adding new visualizations, or implementing high-frequency UI updates in the MixKit.
1. Frame Rate & Timing
- Strict 60fps Pursuit: All visual updates (waveforms, meters, spectrums) MUST use
requestAnimationFrame. Never usesetIntervalfor rendering. - Jank Prevention: Minimize "Long Tasks" (tasks > 50ms). If a calculation (like waveform generation) takes too long, offload it to a Web Worker.
- Delta Timing: If implementing time-based animations, use the
timestampprovided byrequestAnimationFrameto ensure consistent speed regardless of frame rate.
2. GPU Acceleration (WebGL/WebGPU)
- Batching: Minimize draw calls. In WebGL, batch vertex data into large buffers instead of making multiple
drawArrayscalls. - Shader Efficiency: Keep fragment shaders simple. Avoid complex branching logic inside the shader loops.
- Texture Management: When using album art or static waveforms as textures, resize them to "Power of Two" dimensions (e.g., 256x256) for better compatibility and performance.
3. Canvas 2D Optimizations (Legacy/Fallback)
- Offscreen Buffering: Large static elements (like the background waveform) should be rendered once to an offscreen canvas and copied using
drawImagein the main loop. - State Management: Minimize
context.save()andcontext.restore(). Manually reset properties if possible, as state saves are expensive. - Integer Coordinates: Use
Math.floor()orMath.round()on coordinates to prevent sub-pixel rendering, which triggers expensive anti-aliasing.
4. Memory & Garbage Collection
- Object Pooling: Reuse arrays and objects inside the
render()loop to avoid frequent garbage collection spikes. - Typed Arrays: Use
Float32ArrayorUint8Arrayfor audio and vertex data to ensure maximum memory efficiency. - Resource Cleanup: Explicitly delete WebGL buffers, textures, and programs when they are no longer needed to prevent GPU memory leaks.
How it compares
This skill provides specific strategies for optimizing web-based real-time music performance, unlike general web rendering advice.
Compared to similar skills
render-performance side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| render-performance (this skill) | 0 | 5mo | No flags | Advanced |
| rendering-animate-svg | 13 | 7mo | No flags | Beginner |
| react-native-r3f | 0 | 5mo | No flags | Advanced |
| r3f_component_gen | 0 | 5mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
rendering-animate-svg
TheOrcDev
Wrap animated SVG elements in a div to enable hardware acceleration. Apply when animating SVG icons or elements, especially in 8-bit retro components with pixel art animations.
react-native-r3f
TheMystic07
Expert guidance for React Three Fiber development with React, Vite, Tailwind CSS, and three.js
r3f_component_gen
gkrishna247
Templates and standards for creating high-performance 3D components using React Three Fiber.
scroll-experience
davila7
Expert in building immersive scroll-driven experiences - parallax storytelling, scroll animations, interactive narratives, and cinematic web experiences. Like NY Times interactives, Apple product pages, and award-winning web experiences. Makes websites feel like experiences, not just pages. Use when: scroll animation, parallax, scroll storytelling, interactive story, cinematic website.
interaction-design
wshobson
Design and implement microinteractions, motion design, transitions, and user feedback patterns. Use when adding polish to UI interactions, implementing loading states, or creating delightful user experiences.
motion
onmax
Use when adding animations with Motion Vue (motion-v) - provides motion component API, gesture animations, scroll-linked effects, layout transitions, and composables for Vue 3/Nuxt