Commit 728dfef
Bump chunk size for android (facebook#54301)
Summary:
Pull Request resolved: facebook#54301
# Changelog: [Internal]
Previously, we would read every single kilobyte and do Java -> C++ call with `jni`.
For big objects, like source maps, this means that we were doing at least 1024 calls for a single megabyte of incoming data. From my observations, some source maps on Twilight could reach 30Mb+.
There is a trade-off between how much of memory we want to allocate while reading a stream and a runtime. I didn't notice any differences while changing the chunk size from 8Kb to 1Mb and some values in between; in the end it purely depends on the OkHttp's or Okio's implementation of the stream, looks like it uses 8Kb as a chunk size by default:
{F1983042734}
Reviewed By: huntie
Differential Revision: D85652217
fbshipit-source-id: 68474f0b7eece13a0a1c8ea9e617b99a26d81ff91 parent 7164f96 commit 728dfef
File tree
1 file changed
+1
-1
lines changed- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/inspector
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
0 commit comments