-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[RFC] Android RPC service performance issues #1433
Comments
Thanks for looking into this! We’re currently in the process of refactoring
the watchdog implementation in the way you suggested (moving back to the
activity process). This requires getting the watchdog (moving to a service)
to persist when the main activity dies, which may be tricky, but we have a
WIP that looks fairly promising. If this does not work then we may move to
a two-app solution, but ideally one app is less clunky to use.
…On Sat, Jul 14, 2018 at 12:11 PM alex-weaver ***@***.***> wrote:
Using a service process for RPC in Android is causing significant
performance regressions (approximately by a factor of 3 on my test device).
@merrymercy <https://github.com/merrymercy> identified the watchdog
process commit as the cause in #1426
<#1426>
The service/watchdog process was added in #1387
<#1387>
I've confirmed that on my device performance returns to its previous level
if I roll back MainActivity.java to before the service/watchdog was
introduced.
It is unclear precisely why this is occurring, but I've done some
debugging on this and found the following:
- The issue persists if the RPCProcessor is launched in a service but
the watchdog is removed. This demonstrates the performance issue is not due
to the interaction with the watchdog, but simply due to running in the
service process.
- Adding a timer in C++ around GraphRuntime::Run confirms that almost
all of the processing time is taken by this function, and not by java code.
- I have tried setting the service as a foreground service (how to do
this correctly is somewhat poorly documented), since by default service
processes in Android are given lower priority than app processes[1]. This
did not make any difference :(
Any ideas as to why this might be occurring would be appreciated
[1]
https://medium.com/google-developers/who-lives-and-who-dies-process-priorities-on-android-cb151f39044f
@tqchen <https://github.com/tqchen>
@eqy <https://github.com/eqy>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1433>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACIsgB98RgfUrEHsdKhACFL_nwVrih_Aks5uGkI7gaJpZM4VP9-h>
.
|
That sounds great :) Bringing the RPCProcessor back into the activity will definitely resolve the issue, I've just been digging into this because it's somehow unsatisfying without knowing why it was broken in the first place! EDIT: PS if you find yourself needing foreground services, this may be helpful (especially around the changes in Android O): |
close this for now as @merrymercy confirmed that the performance regression is fixed by #1457 @alex-weaver it would be great if you can also verify independently |
Using a service process for RPC in Android is causing significant performance regressions (approximately by a factor of 3 on my test device).
@merrymercy identified the watchdog process commit as the cause in #1426
The service/watchdog process was added in #1387
I've confirmed that on my device performance returns to its previous level if I roll back
MainActivity.java
to before the service/watchdog was introduced.It is unclear precisely why this is occurring, but I've done some debugging on this and found the following:
Any ideas as to why this might be occurring would be appreciated
[1] https://medium.com/google-developers/who-lives-and-who-dies-process-priorities-on-android-cb151f39044f
@tqchen
@eqy
The text was updated successfully, but these errors were encountered: