Menu

Post image 1
Post image 2
1 / 2
0

I Replaced Arrays of Objects with One ArrayBuffer - React Native Became 200x Faster

DEV Community·Alex·20 days ago
#R76o24YC
Reading 0:00
15s threshold

Most JSI benchmarks are misleading. They benchmark the native call itself, but not the actual cost of moving data into JavaScript. In real React Native applications, the bottleneck is often not JSI itself. It’s the shape of the data crossing the boundary. Returning thousands of JavaScript objects from native code creates allocations, property definitions, boxing, hidden classes, and garbage collection pressure. Even with JSI removing the traditional bridge, large payloads can still become surprisingly expensive. After profiling several heavy JSI workloads, I started experimenting with a different approach: no arrays of objects no JSON serialization no parsing no copies Just one contiguous ArrayBuffer . That experiment became react-native-columnar . The Problem A typical JSI module often returns something like this: jsi :: Array array ( rt , rows ); for ( uint32_t i = 0 ; i < rows ; ++ i ) { jsi :: Object obj ( rt ); obj . setProperty ( rt , "id" , i ); obj . setProperty ( rt , "status" , 2 ); obj .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More