No history yet

JSI Architecture Internals

The JSI Revolution

React Native's performance has historically been defined by the communication channel between its JavaScript and native threads. The legacy architecture relied on an asynchronous, message-passing bridge. Every interaction, from a simple state update to a complex animation, required serializing data into a JSON string, sending it across the bridge, and deserializing it on the other side. This process, while robust, introduced inherent latency and overhead, especially for high-frequency updates.

The New Architecture replaces this with the JavaScript Interface, or JSI for short. JSI is not another bridge; it's a lightweight, general-purpose C++ layer that allows JavaScript code to directly invoke methods on C++ objects and vice versa. This is a fundamental paradigm shift. Instead of passing serialized messages, the two realms can now communicate directly and synchronously, eliminating the JSON bottleneck entirely.

Direct Object Communication

The core innovation of JSI is the ability for the JavaScript runtime to hold direct, opaque references to native C++ objects. These are known as Host Objectss. A Host Object is a C++ class that exposes certain methods and properties to the JavaScript world through the JSI API. From the JS side, it looks and feels like a regular JavaScript object. You can call its methods and access its properties, but under the hood, those calls are synchronously executing C++ code.

JSI provides direct access between JavaScript and native objects.

This direct referencing mechanism is what makes synchronous execution possible. While most UI updates remain asynchronous to avoid blocking the main thread, JSI enables high-priority, performance-critical operations to happen instantly. Think of a complex gesture handler that needs to react in real-time or a native module that performs heavy computation. With JSI, the JavaScript thread can call a C++ method and get a result back immediately, without waiting for a message to cross the legacy bridge and return.