Skip to content

Workers vs. Worklets

It is important to distinguish between Worklets (used by Reanimated, VisionCamera, etc.) and Web Workers (this library).

FeatureWorkletsWeb Workers (This library)
Primary GoalCallbacks: High-frequency, specialized logic (Animations, Sensors, Video).Computation: Persistent offloading of CPU-intensive business logic.
LifecycleShort-lived: Usually invoked for specific events or frames.Persistent: Long-running threads that maintain internal state.
ExecutionOften tied to the UI thread or specific specialized threads.True parallelism on dedicated background threads.
StandardCustom React Native concepts (Runtime/Worklet).W3C Web Standard (postMessage, onmessage).
CompatibilityNative-only.Isomorphic (runs on Web and Native).
  • You need to process large datasets (filtering, sorting, mapping).
  • You are performing complex mathematical calculations or encryption.
  • You need code that runs exactly the same on React Native and the Web.
  • You need a persistent background task that manages its own state over time.
  • You are driving animations (Reanimated).
  • You are processing camera frames in real-time (VisionCamera).
  • You need synchronous communication with the UI thread for gesture handling.