James Cameron quozl at laptop.org
Thu Jul 4 20:40:25 EDT 2013

On Thu, Jul 04, 2013 at 01:00:09PM -0700, Yioryos Asprobounitis wrote:
> > So, having someone generate activity startup time numbers in a fair
> > test (i.e. same platform, different software versions) would be of
> > value.
> OK.
> The following script appears to work as expected, but is the result valid?
> ie does the call through sugar-lunch as well as grep, awk, kill etc add to the time result?
> #!/bin/bash
> rm -f output.txt
> for x in $(cat Activities/*/activity/activity.info | grep bundle | cut -f 2 -d '=')
> do
>  echo $x >> output.txt
>  { time sugar-launch $x 2>/dev/null & 
>  sleep 30
>  ME=$(ps aux | grep $x | grep -v grep | awk '{print $2}') 
>  kill -9 $ME ; } 2>> output.txt
>  echo >> output.txt
> done

Interesting, thanks.   An explanation was asked for, so here's one:

This script uses CPU time accounting to measure the time the process
and children spend scheduled on the CPU.

Now on to comment:

This measurement would be fine for minimising the startup CPU time of
the activity, but we know that the CPU time of the X server is as
critical to the situation for many activities.

Measuring only the CPU time doesn't take into account the
wait times due to I/O, such as read and write from internal storage,
audio device opening (which has a depop delay on some platforms), and
possible network delays.

A better measurement to look for is the elapsed time of activity

This is a most interesting value, but it is difficult to obtain
without changing the activity source so that the point of startup
completion is identified.  (That task is made more difficult since
some activities schedule some of their startup _after_ their main

James Cameron

More information about the Devel mailing list