๐ PSA: First-class ArrayBuffer support is coming to TurboModules!
@grabbou16K followers
40,069 views
23 Comments
Comments from the original post on X (Twitter)

@NativeScript
All from a single React component ๐ For an 8 MB payload, that means: - base64 โ ~79 ms ๐ข - direct ArrayBuffer โ ~1 ms ๐ - less language context hops. A stackblitz to play with: Thanks to the entire team at Callstack's work on Node API, maybe one day could use this 'as-is' in React Native. Can still create .swift, .mm, .java, .kt if want too though. Results may vary slightly with different devices (this is iPhone 16 Pro with iOS 26).
20 likes

@hirbod
@_ikswodarap Oh this is really really nice!
5 likes

@t4styycs
@_ikswodarap Nice! I hope the react native team stops using JS base64 for that soon. ๐ I mean the team could have used atleast a native base64 binding for that in http reqs... Source:
3 likes

@grabbou
@_ikswodarap we will get there as a follow-up PR!
3 likes

@t4styycs
@_ikswodarap nice to hear good work โ๏ธ

@hampus_s
@_ikswodarap Yeeeees I need this ๐ฅ
2 likes

@betomoedano
@_ikswodarap @grok explain this post like I'm five
2 likes

@developer163599
@_ikswodarap ๐ฅ
1 like

@mike_perhats
@_ikswodarap Thatโs awesome
1 like

@SzymonRybczak
@_ikswodarap ๐ฅ๐ฅ
1 like

@manny_eI
@_ikswodarap bloody sick!!๐ฅ
1 like

@ddunderfelt
@_ikswodarap Heck yes!! Syncing data from an api into a local database is best done without json parsing, which is a HUGE overhead. This is a super important unlock for TurboModules.
1 like

@ospfranco
@_ikswodarap Does this work with async function? In pure C++ JSI functions we needed to copy the memory to avoid concurrent errors
1 like

@grabbou
@_ikswodarap I am not sure if we will get that in the first draft, but eventually - yes. I currently have (like many others) a few handmade JSI bindings that work with ArrayBuffers in concurrent environments and it works, but it isn't easy
1 like

@RafikovMuhammad
@_ikswodarap This is actually huge for any app that utilizes a large chunks of data (images, videos, llms) and a free performance boost for apps that didn't need it. Huge win for react native
1 like

@codewithimanshu
@_ikswodarap Binary data transfer just got a whole lot faster. This unlocks exciting possibilities for richer mobile experiences. Consider the impact on real-time audio and video.
1 like

@KrTirtho
@_ikswodarap Wait wait what?! It used to be base64? WTF! Was there any limitation? Or, just bad decisions?

@grabbou
- Historically, there was no support for ArrayBuffers "under the hood" - Me and @satya164 worked on bringing Blob to React Native and back then, we made base64 serialization (as it went through bridge anyways) - JSI brings ArrayBuffers support, but BlobManager is still on legacy code - Apparently, it works "good enough", but alternatives emerge (Nitro Modules - first-class support, also, supported in Expo Modules) - Once we bring this to the core, we will begin contributing to all other modules, and hopefully in the nearest future, it will all be thing of the past
9 likes

@PineapplesDev
@_ikswodarap Legend

@GutuCristian
@_ikswodarap Love it!โ๏ธ
