-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android release converting js bundle to byte code is very slow #852
Comments
Possibly duplicate of #135 |
Can you please provide a file reproducing the behavior? |
My first guess is that this is due to slow deduplication. We have something for that, but we would like to confirm it fixes the issue. |
Sorry, I should've provided that upfront. Here's a sample file: https://drive.google.com/file/d/13Wa02PbEmipfmVPHxX2VklLnc-lP84-J/view?usp=sharing |
How many of these files are you using in your app? |
Currently 14, and we may add more in the future |
Okay, and can you verify that you are using Hermes on iOS as well? There shouldn't be a cross-platform difference coming from Hermes with respect to this functionality, so I'm surprised that you aren't experiencing the same thing on both Android and iOS. |
We are using hermes on iOS as well |
Using codepush for the build, it gets stuck here:
Using
|
One more question- are all those |
I compiled that file you gave me on the command line and it took ~15 seconds. At 14 files, that would be ~210sec, or 3.5mins, which is in line with the rest of the times you are experiencing, correct? I think there might be another issue happening here at a layer above Hermes. |
All of the json files are about the same size. Each file added ~3 minutes to the total build time, taking it from 5 minutes to 50 minutes. |
@fbmal7 the separate JSON files get combined into a single .js bundle by Metro, so if there are non-linear effects, performance would drop off sharply. We should try concatenating the provided file 14 times. |
@mmmoussa the one file you linked was solely a bunch of nested arrays with numbers inside of them. Is that type of data consistent with the rest of your files? |
Yes, they are all exactly the same but with different numbers |
@mmmoussa Unfortunately I can't get this to repro. I built a fresh RN app and then downloaded the JSON file you linked and pasted it 6 times, changing some random values around. I then |
Closing, since we are not able to reproduce, and the submitter seems to have a work-around. Please, feel free to re-open if more data is available. |
Reopening the task as the initial method we used to repro was flawed. We are now able to repro the issue, and have attributed the source to the slowdown @tmikov originally hypothesized: slow deduplication |
The proper fix to this issue is finally landed in 221ce. This will not be available in RN until at least 0.72, though. |
Bug Description
We recently added a bunch of json files containing (thousands of) nested arrays of numerical data to our RN app. Each of these files is around 1.2MB minified. We conditionally access the data from within our app through inline requires like this:
const data = require('./path/to/the/file.json');
Running our app in development mode is still working fine as is building a release bundle for iOS. However, with each json file that we added, our Android release build time increased by a few minutes, with our total build time exploding from ~5 minutes to ~50 minutes.
Hermes version: 0.70.4
React Native version (if any): 0.70.4
OS version (if any): MacOS Monterey 12.5.1
Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64): arm
Steps To Reproduce
The Expected Behavior
Android build time changes minimally like is the case with metro bundling and iOS release builds.
The text was updated successfully, but these errors were encountered: