Skip to content

Fetch response implementations benchmark for React Native

Notifications You must be signed in to change notification settings

barthap/fetch-benchmark

Repository files navigation

Fetch response implementations benchmark for React Native

Recreated benchmarks from this tweet on X to compare:

Benchmarks

All benchmakrs are defined in benchmarks/index.ts.

Methodology

  • JSON payload: Used 50MB json from this page. It should be placed in the fixtures/ directory.
  • Localhost hosted to mitigate networking impact (some libraries do proecessing during the await fetch() call instead of await response.<<desiredFormat>>() so networking time could not be fully separated.)_
    • Used cd fixtures && python3 -m http.server (or bun run serve) for simulator/Localhost.
    • Used PocketServer app on physical iOS.
    • The app is also available on Android.

Sample results

Some random results are available in the screenshots directory.

Patched files

In the patches there are two patches:

  • expo - added zero-copy arrayBuffer2() to compare memory copying cost
  • expo-modules-core - (needed for the above) implementations for native ArrayBuffers that have not been released yet.

This is an Expo project created with create-expo-app. App UI was vibe-coded.

About

Fetch response implementations benchmark for React Native

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published