Skip navigation
๐ŸŽ‰ PSA: First-class ArrayBuffer support is coming to TurboModules!
0:00 / 0:23

๐ŸŽ‰ PSA: First-class ArrayBuffer support is coming to TurboModules!

Mike

@grabbou16K followers

Visit on X
418 likesDownloadOriginal post

40,069 views

๐ŸŽ‰ PSA: First-class ArrayBuffer support is coming to TurboModules! No more base64 serialization. Massive performance wins for binary data! For an 8 MB payload, that means: - base64 โ†’ ~666 ms ๐Ÿข - direct ArrayBuffer โ†’ ~1 ms ๐Ÿš€ Huge ๐Ÿ‘ to Kamil Paradowski for shipping this!

23 Comments

Comments from the original post on X (Twitter)

  • NativeScript's profile picture

    @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's profile picture

    @hirbod

    @_ikswodarap Oh this is really really nice!

    5 likes

  • t4styy's profile picture

    @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

  • Mike's profile picture

    @grabbou

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

    3 likes

  • t4styy's profile picture

    @t4styycs

    @_ikswodarap nice to hear good work โœŒ๏ธ

  • Hampus's profile picture

    @hampus_s

    @_ikswodarap Yeeeees I need this ๐Ÿ”ฅ

    2 likes

  • Beto's profile picture

    @betomoedano

    @_ikswodarap @grok explain this post like I'm five

    2 likes

  • developer's profile picture

    @developer163599

    @_ikswodarap ๐Ÿ”ฅ

    1 like

  • Mike Perhats's profile picture

    @mike_perhats

    @_ikswodarap Thatโ€™s awesome

    1 like

  • Szymon Rybczak's profile picture

    @SzymonRybczak

    @_ikswodarap ๐Ÿ”ฅ๐Ÿ”ฅ

    1 like

  • manny's profile picture

    @manny_eI

    @_ikswodarap bloody sick!!๐Ÿ”ฅ

    1 like

  • Daniel Dunderfelt's profile picture

    @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

  • Oscar Franco's profile picture

    @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

  • Mike's profile picture

    @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

  • Rafikov's profile picture

    @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

  • Himanshu Kumar's profile picture

    @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

  • Kingkor Roy Tirtho's profile picture

    @KrTirtho

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

  • Mike's profile picture

    @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

  • neo's profile picture

    @PineapplesDev

    @_ikswodarap Legend

  • Cristian Gutu's profile picture

    @GutuCristian

    @_ikswodarap Love it!โš›๏ธ