WhoBuilt

React Native FastIO: Nitro-Powered Performance Boost

Dec 18, 2024· 45 min· 1.3K views·Watch on YouTube

Speaker

Callstack founder Mike Grabowski joins the host on React Universe On Air: Coffee Talk to discuss React Native FastIO, a Nitro-powered library for I/O APIs, and its architecture, readiness, and use cases.

Why FastIO started

Grabowski says FastIO began as an experiment with Nitro Modules and a WebSocket library. It grew into a set of I/O primitives, including Blob, Fetch, file system, and streams, after he saw how closely those capabilities fit together.

What is ready to use

At the planned public release, WebSockets were ready for testing, and Grabowski described Blob as stable except for streaming. Fetch, the file system, and streams were experimental, with missing APIs and edge cases; he estimated up to three months of work for some of them. He encouraged users to try them and report issues.

A modular, web-compliant design

FastIO separates Nitro specifications, native implementations, and JavaScript wrappers. The specifications define the native contract, while higher-level JavaScript APIs aim to match web behavior; developers can also call native APIs directly when they need platform-specific features. Grabowski wants these primitives to be reusable across React Native and potentially other frameworks.

Binary data and streaming use cases

Grabowski sees FastIO as useful for library authors building tools such as file pickers and video libraries, and for apps that handle large files or real-time data. Blobs can be streamed into Fetch requests chunk by chunk; he described uploading a 1.2 GB file while memory stayed flat, subject to a possible leak. WebSockets also support binary data without converting it to strings.

Performance, feedback, and contribution

Grabowski removed benchmarks after finding that results depended on methodology and did not capture the library’s broader benefits. He highlighted Nitro’s binary-data support and advised evaluating FastIO for a project’s needs rather than assuming it will be faster. He invited contributors to open GitHub issues or help with native streaming and C++ work.

Takeaways

  • Check which FastIO APIs are stable before adopting them; WebSockets and Blob were the most ready at the time of recording.
  • For large uploads, streaming Blob data chunk by chunk can avoid loading the entire file into memory.
  • Treat benchmark results as context-specific and assess performance in your own application.
  • A clear contract between API specifications, native code, and JavaScript wrappers can support portability and platform-specific extensions.
  • Early user feedback can help prioritize experimental APIs and guide open-source development.

Mentioned in this talk

Search inside this talk

What was claimed 9

Related talks