Skip to content
This repository was archived by the owner on Mar 16, 2019. It is now read-only.

Commit 51e5466

Browse files
authored
Update README.md
1 parent 24b8643 commit 51e5466

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ A project committed to make file acess and data transfer easier, effiecient for
2626
* [File access](#user-content-file-access)
2727
* [File stream](#user-content-file-stream)
2828
* [Manage cached files](#user-content-cache-file-management)
29-
* [Performance Tips](#user-content-performance-tips)
3029
* [Web API Polyfills](#user-content-web-api-polyfills)
30+
* [Performance Tips](#user-content-performance-tips)
3131
* [API References](https://github.com/wkh237/react-native-fetch-blob/wiki/Fetch-API)
3232
* [Trouble Shooting](https://github.com/wkh237/react-native-fetch-blob/wiki/Trouble-Shooting)
3333
* [Development](#user-content-development)
@@ -652,12 +652,19 @@ After `0.8.0` we've made some [Web API polyfills](https://github.com/wkh237/reac
652652

653653
### Performance Tips
654654

655-
React Native connects JS and Native context by passing JSON through RCT bridge, therefore there will an overhead to convert data before they sent. When data is large, this will be quite a performance impact to your app. When upload and download large data it's better to use file storage instead of BASE64 encoding. The following chart show how much faster when loading a data from storage than BASE64 encoded string on iphone 6.
655+
---
656+
657+
**Reduce RCT Bridge Overhead and BASE64 Time**
658+
659+
React Native connects JS and Native context by passing JSON through RCT bridge, therefore there will an overhead to convert data before they sent. When data is large, this will be quite a performance impact to your app. When upload and download large data it's better to use file storage instead of BASE64 encoding. The following chart shows how much faster when loading a data from storage than BASE64 encoded string on iphone 6.
656660

657661
<img src="img/performance_1.png" style="width : 100%"/>
658662

659-
TODO
663+
**ASCII Encoding has /terrible Performance**
664+
665+
Due to the [lack of typed array implementation in JavascriptCore, and limitation of React Native structure](https://github.com/facebook/react-native/issues/1424), to convert data to JS byte array spends lot of time. Use it only when needed, the following chart shows how much time it takes when reading a file with different encoding.
660666

667+
<img src="img/performance_encode.png" style="width : 100%"/>
661668

662669
## Changes
663670

0 commit comments

Comments
 (0)