⚡AgentSkills
🎨 Frontend Engineering · Rendering Strategy

Move heavy work off the main thread properly

Worker pool sizing, transferable payloads, and Comlink-style RPC keeping UI at 60fps.

advanced~45 minFrontend EngineersFull-Stack DevelopersDesign Engineers

Steps

  1. 1Profile first: identify tasks blocking main thread >50ms consistently
  2. 2Pool workers = hardwareConcurrency minus reserve; reuse, don't spawn per task
  3. 3Transfer ArrayBuffers instead of structured-cloning large payloads
  4. 4Design message protocol versioned — workers update independently of pages
  5. 5Fallback to main-thread execution behind feature detection for old browsers
  6. 6Guard against worker startup latency for tiny tasks — often net-negative

Common Pitfalls

  • ▲PostMessage cloning multi-MB datasets negating compute savings
  • ▲Workers importing entire app bundles via accidental transitive imports

Commands

Install with skills CLI
$ npx skills add aniruddhaadak80/skills --skill rendering-strategy-web-workers-architecture
Install globally
$ npx skills add aniruddhaadak80/skills --skill rendering-strategy-web-workers-architecture -g

Tags

#web-workers#performance#architecture#frontend-engineering#rendering-strategy

Related skills

Static/ISR/SSR/streaming/client mapped to freshness needs, personalization, and TTFB budgets.

🎨 Frontend Engineering·~40m