-
Notifications
You must be signed in to change notification settings - Fork 162
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
Try rsync instead of archive + scp #22
Comments
Ah, I see the difference now. I've omitted syncing some of the build files, namely the For the typical use case of compiling and deploying an APK, those files are not needed and a lot of time can be saved by excluding them. Here's a snippet with project details omitted of the script that I'm using:
This approach will only sync changed files and will be beneficial to projects that use a lot of assets that do not change often between compilation. |
Without |
Hmm with this script, I haven't been prompted for any syncs. Mainly only getting back the compiled APKs and a few generated files which should not trigger a sync requirement. |
For example: we use annotation processing that generates classes, without pulling |
Generated code goes into |
@gabrielittner right right, but to launch tests we need Anyway, this will be solved by introdusing |
The discussion only talk about the build file and pulling these file from the server, but what about the uploading part of the source code. I think on this side rsync could be better than tar+scp, especially for a project with a lot of res file like drawable. We could maybe use both method. What do you think? |
I included tar + scpTime to local tar excl */build:
Time to scp from local to remote:
Time to remote untar:
Time to remote tar just /build and */build:
Time to scp from remote to local:
Time to local untar:
Total time: 12.905 seconds rsyncFirst pass from clean buildTime to rsync to remote:
Time to rsync back to local:
Total time: 16.421 seconds Second pass with 3 lines of edited codeTime to sync to remote:
Time to sync back to local:
Total time: 4.787 seconds ResultsFrom my quick tests, tar + scp takes roughly the same amount of time every build. rsync is slower than tar + scp by 3.516 seconds on its first run (16.421 vs 12.905) as it has to copy the entire project directly at first and also sync the entire build folder after it has finished building on remote. However, there are far fewer files (8638 build files generated at first, 2436 changed on next run) on the second run to rsync to remote and back. This is significantly faster than tar + scp for every subsequent run (4.787 vs 12.905) as most of the files in |
@steventannz Huh, this is very interesting, thank you for the stats! We’ll try it out locally in different configurations to be sure we want to switch, but this is definitely looks promising! |
@steventannz good results, thanks! If you have time — feel free to make PR with switching to |
Today i was experimenting with rsync, and i can verify the above. Only the first time rsync is slower, but after that, its way faster. I have forked this project in order to experiment with the rsync. With the feedback from this issue, i have added the rsync functionality. The code is not very good (this is the first time that i am writing bash), but i thought that it might help https://github.com/kokeroulis/mainframer I could create a PR, but it might take a few days to fix the code because of christmas. |
@kokeroulis thanks! We'll try it. @ming13 let's dive into |
Closed by #35! |
Though in our case we generate about 10k build files on each build and rsync might be slower than simple
tar
+scp
.See this discussion for more info: https://twitter.com/steventannz/status/811460935101493248
The text was updated successfully, but these errors were encountered: