Lance Nanek wrote:
> Good point. Some quick trials here do seem to indicate that the GC
> firing in a different process doesn't stop the world for a game like
> the GC firing in the game's does. So GC from other processes isn't as
> bad. Tested on a Droid running Android 2.0.1.

Agreed.

I just got through a bunch of tests using two processes, one with a
activity doing a whole lotta work (more square roots than you can shake
a stick at) and one with a service. The service would trigger a
different GC pattern (few massive allocations, tons of little ones,
etc.) based on an Intent extra provided by the activity. I tried to let
things settle out with each process before the testing really began.

Results:

-- On a factory-reset G1 with Android 1.6: CPU and GC from the
background process steals 5-10% of throughput from the foreground
compared to no service work at all, which would fit if the background
logic is in the low-priority class that Ms. Hackborn described.

-- On a Google Ion with Android 1.5: the background process running in
use-the-CPU-mode would steal half the CPU time, about what you would
expect for all app processes having equivalent priority. For the
force-the-GC mode, at points when GC was actively cleaning stuff up, it
would steal 25-75% of the CPU, also fitting expectations, though I was a
bit surprised as to the severity of some of the spikes.

-- On an 2.1 emulator (running on a quad-core): the background process
barely scratched the finish on the foreground process. I was actually a
bit surprised at this, as I would have expected results closer to the G1
case rather than better.

There are a few more experiments I may run later this week, such as
startForeground() and having the background stuff be an activity back on
the stack instead of a service, to see the impacts those might have. And
I'll probably toss this stuff in a github repo around then as well.

Nothing like the power of testing, compared to dealing with anecdotes...

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android 2.0 Programming Books: http://commonsware.com/books

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to