I've recently been investigating some app startup time issues on quad-core
devices (like the nexus 5) and needed a way to find out how good the
Gallery app is at using all the available cores when it starts up.

I ended up writing a python script that uses adb to read /proc/stat from
the connected device, then wait 5 seconds, then read it again. By
subtracting the first set of numbers from the second set, I can figure out
how busy or idle each core was during the 5 second wait.

My plan is to start with an idle phone, start this script, then launch my
app, and I hope that the output will tell me how well the app is using the
available cpu resources while it starts up.

Here's the output I get when I launch the Gallery app:

$ ./adbcores
measuring CPU usage over 5 seconds
CPU     BUSY%   IDLE%   WAIT%
0       72%     56%     0%
1       20%     80%     0%
2       22%     78%     0%
3       16%     84%     0%

This shows me that Gecko and my Gallery app aren't really taking good
advantage of this quad-core device.

For all I know someone has already written an equivalent or better utility.
But if this sounds interesting to you, you can grab the script from
https://github.com/davidflanagan/adbcores

  David

P.S.: since this script just uses adb and /proc/stat it works for Android
just as well as FirefoxOS
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to