added some thoughts about scheduler doing a little profiling on elements
[platform/upstream/gstreamer.git] / docs / random / ensonic / profiling.txt
1 $Id$
2
3 Could schedulers do a little profiling?
4
5 * scheduler keeps a list of usecs the process function of each element was
6   running
7 * process functions are: loop, chain, get
8 * scheduler keeps a sum of all times
9 * each gst-element has a profile_percentage field
10
11 * when going to play
12   * scheduler sets sum and all usecs in the list to 0
13 * when handling an element
14   * remember old usecs t_old
15   * take time t1
16   * call elements processing function
17   * take time t2
18   * t_new=t2-t1
19   * sum+=(t_new-t_old)
20   * profile_percentage=t_new/sum;
21   * should the percentage be averaged?
22      * profile_percentage=(profile_percentage+(t_new/sum))/2.0;
23
24 * the profile_percentage shows how much CPU time the element uses in relation
25   to the whole pipeline
26