Skip to main content

One post tagged with "announcement"

View All Tags

react-native-workers 1.0.0-alpha: real multithreading for React Native

· 16 min read
Ammar Ahmed
Author of react-native-workers

React Native has always been single-threaded where it matters most. Your JavaScript runs on one thread, and anything heavy you do there — parsing a big payload, hashing, compression, image work, a chatty reducer, a busy render — competes with the UI for the same runtime. The usual advice is "move it native," but that means writing a native module for every heavy thing you'd rather just write in JS.

react-native-workers brings the Web's answer to this problem to React Native: real background threads, each with its own JavaScript runtime, behind the Worker API you already know from the browser. Today it enters public alpha as 1.0.0-alpha.

This post is the full tour — what it is, how it's built, everything it can do (including some things a worker library usually can't), how hard it's been tested, what's still rough, and where it's going.

Image filters running in a worker on pixels held in a SharedBuffer. Each run reports the worst UI frame gap it caused — one frame, while a 250 ms blur runs.
Parallel parse screen: 120,000 log lines parsed by 1, 2, 4 and 8 workers, taking 54ms, 29ms, 18ms and 17ms — a 3.18× speedup
The same 2.58 MB of logs parsed by 1, 2, 4 and 8 nested workers over one shared buffer — 54 ms down to 17 ms.