brainstorming for UDS-N - Performance

John McCabe-Dansted gmatht at gmail.com
Mon Oct 4 16:57:03 BST 2010


On Mon, Oct 4, 2010 at 5:28 PM, Matthew Paul Thomas <mpt at canonical.com> wrote:
> Well then, here's a simple task to start with: We should have a single
> graph showing, for every application installed by default in Ubuntu over
> the past six months, how long that application took each day to show a
> non-splash-screen window after a cold launch.
>
> How *would* someone automate that?

I'd use a script similar to the following:

#!/bin/bash
time_start() {
echo 3 > /proc/sys/vm/drop_caches
PROGRAM_NAME=$1
WINDOW_TITLE=$2
echo "$1" "$2"
"$PROGRAM_NAME" &  # Start foobar
while ! wmctrl -R "$WINDOW_TITLE"  # Attempt to raise window
do
  sleep 0.05
done
wmctrl -c "$WINDOW_TITLE"  # Close window
}

time time_start firefox Firefox
time time_start oowriter "OpenOffice.org Writer"
...

-- 
John C. McCabe-Dansted



More information about the ubuntu-devel mailing list