Re: Some performance notes



Owen Taylor <otaylor redhat com> writes:

> > I have been instrumenting GTK with the attached files, and it shows
> > delays of up to a second from the first configure is received until
> > gtk_container_idle_sizer() calls gdk_flush().  This is with testgtk'
> > toplevel.
> 
> And until the first configure until gtk_container_idle_sizer()
> is called? (Is this with -dumbSched or not?)

This is with -dumbSched.

Attached is a patch and a set of data produced by resizing the testgtk
window a few times.

stamp     cumulative,    file:line        text
    0.00003     0.00000  received configure                                  gtkwindow.c:2813
    0.03399     0.03396  received configure                                  gtkwindow.c:2813
    0.03871     0.00473  size allocating                                     gtkcontainer.c:1014
    0.03872     0.00001  done (elapsed 0.00001)                              gtkcontainer.c:1028
    0.03872     0.00000  process all updates                                 gtkcontainer.c:1030
    0.15275     0.11403  done (elapsed 0.11403)                              gtkcontainer.c:1032
    1.43570     1.28295  received configure                                  gtkwindow.c:2813
    1.47341     0.03771  received configure                                  gtkwindow.c:2813
    1.49817     0.02476  received configure                                  gtkwindow.c:2813
    1.51671     0.01854  received configure                                  gtkwindow.c:2813
    1.58909     0.07238  received configure                                  gtkwindow.c:2813
    1.60345     0.01436  received configure                                  gtkwindow.c:2813
    1.61866     0.01521  received configure                                  gtkwindow.c:2813
    1.63215     0.01350  received configure                                  gtkwindow.c:2813
    1.64670     0.01455  received configure                                  gtkwindow.c:2813
    1.66109     0.01439  received configure                                  gtkwindow.c:2813
    1.67521     0.01412  received configure                                  gtkwindow.c:2813
    1.68835     0.01314  received configure                                  gtkwindow.c:2813
    1.70462     0.01627  received configure                                  gtkwindow.c:2813
    1.71761     0.01299  received configure                                  gtkwindow.c:2813
    1.72629     0.00868  received configure                                  gtkwindow.c:2813
    1.74968     0.02339  received configure                                  gtkwindow.c:2813
    1.76361     0.01394  received configure                                  gtkwindow.c:2813
    1.77759     0.01398  received configure                                  gtkwindow.c:2813
    1.78531     0.00772  received configure                                  gtkwindow.c:2813
    1.87230     0.08699  received configure                                  gtkwindow.c:2813
    3.16552     1.29322  received configure                                  gtkwindow.c:2813
    3.17035     0.00483  received configure                                  gtkwindow.c:2813
    3.17372     0.00337  size allocating                                     gtkcontainer.c:1014
    3.48212     0.30840  done (elapsed 0.30840)                              gtkcontainer.c:1028
    3.48213     0.00001  process all updates                                 gtkcontainer.c:1030
    3.62798     0.14585  done (elapsed 0.14585)                              gtkcontainer.c:1032
    3.62909     0.00111  received configure                                  gtkwindow.c:2813
    3.63428     0.00519  received configure                                  gtkwindow.c:2813
    3.63790     0.00362  received configure                                  gtkwindow.c:2813
    3.64142     0.00352  received configure                                  gtkwindow.c:2813
    3.64499     0.00357  received configure                                  gtkwindow.c:2813
    3.64851     0.00352  received configure                                  gtkwindow.c:2813
    3.65204     0.00353  received configure                                  gtkwindow.c:2813
    3.65606     0.00403  received configure                                  gtkwindow.c:2813
    3.65961     0.00354  received configure                                  gtkwindow.c:2813
    3.66317     0.00356  received configure                                  gtkwindow.c:2813
    3.66671     0.00354  received configure                                  gtkwindow.c:2813
    3.67024     0.00354  received configure                                  gtkwindow.c:2813
    3.67417     0.00393  received configure                                  gtkwindow.c:2813
    3.67772     0.00355  received configure                                  gtkwindow.c:2813
    3.68183     0.00410  received configure                                  gtkwindow.c:2813
    3.68574     0.00392  received configure                                  gtkwindow.c:2813
    3.68839     0.00264  size allocating                                     gtkcontainer.c:1014
    3.80108     0.11269  done (elapsed 0.11269)                              gtkcontainer.c:1028
    3.80109     0.00001  process all updates                                 gtkcontainer.c:1030
    4.01936     0.21827  done (elapsed 0.21827)                              gtkcontainer.c:1032
    4.10724     0.08788  received configure                                  gtkwindow.c:2813
    4.11094     0.00370  size allocating                                     gtkcontainer.c:1014
    4.46422     0.35328  done (elapsed 0.35328)                              gtkcontainer.c:1028
    4.46423     0.00001  process all updates                                 gtkcontainer.c:1030
    4.74047     0.27624  done (elapsed 0.27624)                              gtkcontainer.c:1032
    4.74178     0.00131  received configure                                  gtkwindow.c:2813
    4.74726     0.00548  received configure                                  gtkwindow.c:2813
    4.75086     0.00361  received configure                                  gtkwindow.c:2813
    4.75449     0.00363  received configure                                  gtkwindow.c:2813
    4.75819     0.00370  received configure                                  gtkwindow.c:2813
    4.76190     0.00371  received configure                                  gtkwindow.c:2813
    4.76607     0.00418  received configure                                  gtkwindow.c:2813
    4.76978     0.00371  received configure                                  gtkwindow.c:2813
    4.77351     0.00373  received configure                                  gtkwindow.c:2813
    4.77722     0.00370  received configure                                  gtkwindow.c:2813
    4.78092     0.00370  received configure                                  gtkwindow.c:2813
    4.78505     0.00413  received configure                                  gtkwindow.c:2813
    4.78876     0.00371  received configure                                  gtkwindow.c:2813
    4.79254     0.00377  received configure                                  gtkwindow.c:2813
    4.79625     0.00371  received configure                                  gtkwindow.c:2813
    4.79995     0.00371  received configure                                  gtkwindow.c:2813
    4.80502     0.00507  received configure                                  gtkwindow.c:2813
    4.80883     0.00380  received configure                                  gtkwindow.c:2813
    4.81243     0.00360  received configure                                  gtkwindow.c:2813
    4.81604     0.00361  received configure                                  gtkwindow.c:2813
    4.81889     0.00285  size allocating                                     gtkcontainer.c:1014
    4.93798     0.11909  done (elapsed 0.11909)                              gtkcontainer.c:1028
    4.93799     0.00001  process all updates                                 gtkcontainer.c:1030
    5.33069     0.39270  done (elapsed 0.39270)                              gtkcontainer.c:1032
    5.35426     0.02357  received configure                                  gtkwindow.c:2813
    5.36222     0.00796  received configure                                  gtkwindow.c:2813
    5.37143     0.00921  received configure                                  gtkwindow.c:2813
    5.37507     0.00363  received configure                                  gtkwindow.c:2813
    5.37877     0.00370  received configure                                  gtkwindow.c:2813
    5.38226     0.00349  received configure                                  gtkwindow.c:2813
    5.38634     0.00408  received configure                                  gtkwindow.c:2813
    5.38988     0.00354  received configure                                  gtkwindow.c:2813
    5.39276     0.00288  size allocating                                     gtkcontainer.c:1014
    5.52074     0.12798  done (elapsed 0.12798)                              gtkcontainer.c:1028
    5.52074     0.00001  process all updates                                 gtkcontainer.c:1030
    5.86163     0.34088  done (elapsed 0.34088)                              gtkcontainer.c:1032
    6.09915     0.23753  received configure                                  gtkwindow.c:2813
    6.10827     0.00912  received configure                                  gtkwindow.c:2813
    6.11109     0.00282  size allocating                                     gtkcontainer.c:1014
    6.33009     0.21899  done (elapsed 0.21899)                              gtkcontainer.c:1028
    6.33010     0.00001  process all updates                                 gtkcontainer.c:1030
    6.78705     0.45695  done (elapsed 0.45695)                              gtkcontainer.c:1032
    6.78829     0.00124  received configure                                  gtkwindow.c:2813
    6.79219     0.00390  received configure                                  gtkwindow.c:2813
    6.79574     0.00355  received configure                                  gtkwindow.c:2813
    6.79913     0.00339  received configure                                  gtkwindow.c:2813
    6.80301     0.00388  received configure                                  gtkwindow.c:2813
    6.80673     0.00372  received configure                                  gtkwindow.c:2813
    6.80999     0.00326  received configure                                  gtkwindow.c:2813
    6.81332     0.00333  received configure                                  gtkwindow.c:2813
    6.81660     0.00329  received configure                                  gtkwindow.c:2813
    6.81988     0.00328  received configure                                  gtkwindow.c:2813
    6.82357     0.00369  received configure                                  gtkwindow.c:2813
    6.82689     0.00332  received configure                                  gtkwindow.c:2813
    6.82935     0.00246  size allocating                                     gtkcontainer.c:1014
    6.93686     0.10751  done (elapsed 0.10751)                              gtkcontainer.c:1028
    6.93686     0.00001  process all updates                                 gtkcontainer.c:1030
    7.00176     0.06490  done (elapsed 0.06490)                              gtkcontainer.c:1032
    7.22981     0.22804  received configure                                  gtkwindow.c:2813
    7.23453     0.00472  received configure                                  gtkwindow.c:2813
    7.23776     0.00323  size allocating                                     gtkcontainer.c:1014
    7.49601     0.25825  done (elapsed 0.25825)                              gtkcontainer.c:1028
    7.49602     0.00001  process all updates                                 gtkcontainer.c:1030
    7.56024     0.06422  done (elapsed 0.06422)                              gtkcontainer.c:1032
    7.56134     0.00109  received configure                                  gtkwindow.c:2813
    7.56559     0.00426  received configure                                  gtkwindow.c:2813
    7.56918     0.00359  received configure                                  gtkwindow.c:2813
    7.57293     0.00375  received configure                                  gtkwindow.c:2813
    7.57654     0.00361  received configure                                  gtkwindow.c:2813
    7.58012     0.00358  received configure                                  gtkwindow.c:2813
    7.58516     0.00504  received configure                                  gtkwindow.c:2813
    7.58879     0.00362  received configure                                  gtkwindow.c:2813
    7.59252     0.00373  received configure                                  gtkwindow.c:2813
    7.59614     0.00362  received configure                                  gtkwindow.c:2813
    7.59959     0.00346  size allocating                                     gtkcontainer.c:1014
    7.71420     0.11461  done (elapsed 0.11461)                              gtkcontainer.c:1028
    7.71421     0.00001  process all updates                                 gtkcontainer.c:1030
    7.90220     0.18798  done (elapsed 0.18798)                              gtkcontainer.c:1032
    7.90646     0.00426  received configure                                  gtkwindow.c:2813
    7.91049     0.00403  received configure                                  gtkwindow.c:2813
    7.95442     0.04392  received configure                                  gtkwindow.c:2813
    7.95833     0.00391  received configure                                  gtkwindow.c:2813
    7.96188     0.00355  received configure                                  gtkwindow.c:2813
    7.99475     0.03288  received configure                                  gtkwindow.c:2813
    7.99860     0.00384  received configure                                  gtkwindow.c:2813
    8.00216     0.00356  received configure                                  gtkwindow.c:2813
    8.02051     0.01835  received configure                                  gtkwindow.c:2813
    8.02455     0.00404  received configure                                  gtkwindow.c:2813
    8.02857     0.00403  received configure                                  gtkwindow.c:2813
    8.03160     0.00303  size allocating                                     gtkcontainer.c:1014
    8.17511     0.14351  done (elapsed 0.14351)                              gtkcontainer.c:1028
    8.17512     0.00001  process all updates                                 gtkcontainer.c:1030
    8.36792     0.19280  done (elapsed 0.19280)                              gtkcontainer.c:1032
    8.36921     0.00129  received configure                                  gtkwindow.c:2813
    8.38792     0.01871  received configure                                  gtkwindow.c:2813
    8.39461     0.00669  received configure                                  gtkwindow.c:2813
    8.39846     0.00385  received configure                                  gtkwindow.c:2813
    8.50411     0.10565  received configure                                  gtkwindow.c:2813
    8.50831     0.00420  received configure                                  gtkwindow.c:2813
    8.51215     0.00384  received configure                                  gtkwindow.c:2813
    8.51623     0.00409  received configure                                  gtkwindow.c:2813
    8.52029     0.00406  received configure                                  gtkwindow.c:2813
    8.54372     0.02343  received configure                                  gtkwindow.c:2813
    8.54736     0.00365  received configure                                  gtkwindow.c:2813
    8.55101     0.00365  received configure                                  gtkwindow.c:2813
    8.60441     0.05340  received configure                                  gtkwindow.c:2813
    8.60790     0.00349  received configure                                  gtkwindow.c:2813
    8.61133     0.00343  received configure                                  gtkwindow.c:2813
    8.61460     0.00328  size allocating                                     gtkcontainer.c:1014
    8.85437     0.23977  done (elapsed 0.23977)                              gtkcontainer.c:1028
    8.85438     0.00001  process all updates                                 gtkcontainer.c:1030
    9.20562     0.35124  done (elapsed 0.35124)                              gtkcontainer.c:1032
    9.20800     0.00239  received configure                                  gtkwindow.c:2813
    9.21443     0.00643  received configure                                  gtkwindow.c:2813
    9.22483     0.01040  received configure                                  gtkwindow.c:2813
    9.23261     0.00778  received configure                                  gtkwindow.c:2813
    9.23914     0.00652  received configure                                  gtkwindow.c:2813
    9.24986     0.01072  received configure                                  gtkwindow.c:2813
    9.25883     0.00897  received configure                                  gtkwindow.c:2813
    9.26377     0.00494  received configure                                  gtkwindow.c:2813
    9.27297     0.00920  received configure                                  gtkwindow.c:2813
    9.28331     0.01034  received configure                                  gtkwindow.c:2813
    9.29118     0.00787  received configure                                  gtkwindow.c:2813
    9.29637     0.00519  received configure                                  gtkwindow.c:2813
    9.30272     0.00635  received configure                                  gtkwindow.c:2813
    9.32376     0.02104  received configure                                  gtkwindow.c:2813
    9.33048     0.00672  received configure                                  gtkwindow.c:2813
    9.34993     0.01945  received configure                                  gtkwindow.c:2813
    9.36894     0.01902  received configure                                  gtkwindow.c:2813
    9.37701     0.00806  received configure                                  gtkwindow.c:2813
    9.38165     0.00465  received configure                                  gtkwindow.c:2813
    9.40493     0.02328  received configure                                  gtkwindow.c:2813
    9.42327     0.01833  received configure                                  gtkwindow.c:2813
    9.43027     0.00701  received configure                                  gtkwindow.c:2813
    9.44823     0.01795  received configure                                  gtkwindow.c:2813
    9.45946     0.01124  received configure                                  gtkwindow.c:2813
    9.47393     0.01446  received configure                                  gtkwindow.c:2813
    9.48103     0.00710  received configure                                  gtkwindow.c:2813
    9.49947     0.01844  received configure                                  gtkwindow.c:2813
    9.50734     0.00787  received configure                                  gtkwindow.c:2813
    9.51163     0.00429  received configure                                  gtkwindow.c:2813
    9.51534     0.00371  received configure                                  gtkwindow.c:2813
    9.51905     0.00371  received configure                                  gtkwindow.c:2813
    9.53690     0.01784  received configure                                  gtkwindow.c:2813
    9.54095     0.00405  received configure                                  gtkwindow.c:2813
    9.54412     0.00317  size allocating                                     gtkcontainer.c:1014
    9.91870     0.37458  done (elapsed 0.37458)                              gtkcontainer.c:1028
    9.91871     0.00001  process all updates                                 gtkcontainer.c:1030
   10.31436     0.39565  done (elapsed 0.39565)                              gtkcontainer.c:1032
   10.31823     0.00387  received configure                                  gtkwindow.c:2813
   10.32859     0.01036  received configure                                  gtkwindow.c:2813
   10.33628     0.00769  received configure                                  gtkwindow.c:2813
   10.34485     0.00857  received configure                                  gtkwindow.c:2813
   10.35548     0.01063  received configure                                  gtkwindow.c:2813
   10.36487     0.00939  received configure                                  gtkwindow.c:2813
   10.36989     0.00502  received configure                                  gtkwindow.c:2813
   10.37643     0.00654  received configure                                  gtkwindow.c:2813
   10.38702     0.01059  received configure                                  gtkwindow.c:2813
   10.39494     0.00792  received configure                                  gtkwindow.c:2813
   10.39984     0.00491  received configure                                  gtkwindow.c:2813
   10.40684     0.00700  received configure                                  gtkwindow.c:2813
   10.41681     0.00997  received configure                                  gtkwindow.c:2813
   10.42527     0.00846  received configure                                  gtkwindow.c:2813
   10.43033     0.00505  received configure                                  gtkwindow.c:2813
   10.43666     0.00634  received configure                                  gtkwindow.c:2813
   10.44728     0.01062  received configure                                  gtkwindow.c:2813
   10.45526     0.00798  received configure                                  gtkwindow.c:2813
   10.46747     0.01221  received configure                                  gtkwindow.c:2813
   10.47518     0.00770  received configure                                  gtkwindow.c:2813
   10.48794     0.01277  received configure                                  gtkwindow.c:2813
   10.49607     0.00813  received configure                                  gtkwindow.c:2813
   10.50473     0.00866  received configure                                  gtkwindow.c:2813
   10.51531     0.01058  received configure                                  gtkwindow.c:2813
   10.52390     0.00859  received configure                                  gtkwindow.c:2813
   10.52883     0.00494  received configure                                  gtkwindow.c:2813
   10.53557     0.00673  received configure                                  gtkwindow.c:2813
   10.54615     0.01059  received configure                                  gtkwindow.c:2813
   10.55419     0.00804  received configure                                  gtkwindow.c:2813
   10.55912     0.00493  received configure                                  gtkwindow.c:2813
   10.56625     0.00713  received configure                                  gtkwindow.c:2813
   10.57726     0.01101  received configure                                  gtkwindow.c:2813
   10.58532     0.00806  received configure                                  gtkwindow.c:2813
   10.59025     0.00494  received configure                                  gtkwindow.c:2813
   10.59696     0.00671  received configure                                  gtkwindow.c:2813
   10.60716     0.01020  received configure                                  gtkwindow.c:2813
   10.61551     0.00835  received configure                                  gtkwindow.c:2813
   10.61843     0.00291  size allocating                                     gtkcontainer.c:1014
   10.80748     0.18905  done (elapsed 0.18905)                              gtkcontainer.c:1028
   10.80749     0.00001  process all updates                                 gtkcontainer.c:1030
   11.39022     0.58273  done (elapsed 0.58273)                              gtkcontainer.c:1032
   11.39871     0.00849  received configure                                  gtkwindow.c:2813
   11.40687     0.00816  received configure                                  gtkwindow.c:2813
   11.41146     0.00459  received configure                                  gtkwindow.c:2813
   11.41808     0.00663  received configure                                  gtkwindow.c:2813
   11.42764     0.00955  received configure                                  gtkwindow.c:2813
   11.43837     0.01073  received configure                                  gtkwindow.c:2813
   11.44431     0.00595  received configure                                  gtkwindow.c:2813
   11.44801     0.00369  received configure                                  gtkwindow.c:2813
   11.45156     0.00356  received configure                                  gtkwindow.c:2813
   11.45561     0.00405  received configure                                  gtkwindow.c:2813
   11.45918     0.00356  received configure                                  gtkwindow.c:2813
   11.46302     0.00384  received configure                                  gtkwindow.c:2813
   11.46665     0.00363  received configure                                  gtkwindow.c:2813
   11.47029     0.00364  received configure                                  gtkwindow.c:2813
   11.47518     0.00488  received configure                                  gtkwindow.c:2813
   11.47890     0.00372  received configure                                  gtkwindow.c:2813
   11.48281     0.00391  received configure                                  gtkwindow.c:2813
   11.48665     0.00384  received configure                                  gtkwindow.c:2813
   11.49034     0.00369  received configure                                  gtkwindow.c:2813
   11.49432     0.00398  received configure                                  gtkwindow.c:2813
   11.49794     0.00362  received configure                                  gtkwindow.c:2813
   11.50145     0.00352  received configure                                  gtkwindow.c:2813
   11.50557     0.00412  received configure                                  gtkwindow.c:2813
   11.50988     0.00431  received configure                                  gtkwindow.c:2813
   11.51381     0.00393  received configure                                  gtkwindow.c:2813
   11.51737     0.00356  received configure                                  gtkwindow.c:2813
   11.52013     0.00276  size allocating                                     gtkcontainer.c:1014
   11.66936     0.14923  done (elapsed 0.14923)                              gtkcontainer.c:1028
   11.66937     0.00001  process all updates                                 gtkcontainer.c:1030
   12.04493     0.37556  done (elapsed 0.37556)                              gtkcontainer.c:1032
   12.04604     0.00112  received configure                                  gtkwindow.c:2813
   12.04993     0.00389  received configure                                  gtkwindow.c:2813
   12.05650     0.00656  size allocating                                     gtkcontainer.c:1014
   12.16549     0.10900  done (elapsed 0.10900)                              gtkcontainer.c:1028
   12.16550     0.00001  process all updates                                 gtkcontainer.c:1030
   12.52396     0.35846  done (elapsed 0.35846)                              gtkcontainer.c:1032
? widget.patch
? patch
? gprofiler.c
? gdk/gprofiler.c
? gdk/gprofiler.h
? gdk-pixbuf/gmon.out
? gtk/gmon.out
Index: gdk/Makefile.am
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/Makefile.am,v
retrieving revision 1.67
diff -u -r1.67 Makefile.am
--- gdk/Makefile.am	2001/05/20 18:25:34	1.67
+++ gdk/Makefile.am	2001/08/14 18:38:36
@@ -69,6 +69,7 @@
 	gdktypes.h	\
 	gdkvisual.h	\
 	gdkwindow.h	\
+	gprofiler.h	\
 @STRIP_END@
 
 gdk_headers = @STRIP_BEGIN@       \
@@ -101,6 +102,7 @@
 	gdkregion-generic.c	\
 	gdkregion-generic.h	\
 	gdkwindow.c		\
+	gprofiler.c		\
 @STRIP_END@
 
 #
Index: gdk/gdkwindow.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/gdkwindow.c,v
retrieving revision 1.120
diff -u -r1.120 gdkwindow.c
--- gdk/gdkwindow.c	2001/07/18 20:09:27	1.120
+++ gdk/gdkwindow.c	2001/08/14 18:38:36
@@ -932,6 +932,7 @@
 
   gdk_region_destroy (paint->region);
   g_free (paint);
+
 #endif /* USE_BACKING_STORE */
 }
 
@@ -1844,12 +1845,12 @@
 	  
 	  event.expose.region = expose_region;
 	  gdk_region_get_clipbox (expose_region, &event.expose.area);
-	  
+
 	  if (!gdk_region_empty (expose_region))
 	    {
 	      (*gdk_event_func) (&event, gdk_event_data);
 	    }
-
+	  
 	  if (expose_region != update_area)
 	    gdk_region_destroy (expose_region);
 	  gdk_window_unref (window);
Index: gtk/gtkbutton.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkbutton.c,v
retrieving revision 1.65
diff -u -r1.65 gtkbutton.c
--- gtk/gtkbutton.c	2001/07/18 23:39:21	1.65
+++ gtk/gtkbutton.c	2001/08/14 18:38:36
@@ -703,7 +703,7 @@
       button = GTK_BUTTON (widget);
 
       gtk_button_get_props (button, &default_border, &default_outside_border, &interior_focus);
-	
+	  
       x = 0;
       y = 0;
       width = widget->allocation.width - GTK_CONTAINER (widget)->border_width * 2;
@@ -782,16 +782,12 @@
 gtk_button_expose (GtkWidget      *widget,
 		   GdkEventExpose *event)
 {
-  GtkBin *bin;
-
   g_return_val_if_fail (widget != NULL, FALSE);
   g_return_val_if_fail (GTK_IS_BUTTON (widget), FALSE);
   g_return_val_if_fail (event != NULL, FALSE);
 
   if (GTK_WIDGET_DRAWABLE (widget))
     {
-      bin = GTK_BIN (widget);
-      
       gtk_button_paint (widget, &event->area);
       
       (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
Index: gtk/gtkcontainer.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkcontainer.c,v
retrieving revision 1.85
diff -u -r1.85 gtkcontainer.c
--- gtk/gtkcontainer.c	2001/07/20 18:05:32	1.85
+++ gtk/gtkcontainer.c	2001/08/14 18:38:36
@@ -37,6 +37,8 @@
 #include <gobject/gobjectnotifyqueue.c>
 #include <gobject/gvaluecollector.h>
 
+#define G_ENABLE_PROFILER
+#include "gdk/gprofiler.h"
 
 enum {
   ADD,
@@ -1009,6 +1011,7 @@
    * than trying to explicitely work around them with some extra flags,
    * since it doesn't cause any actual harm.
    */
+  G_PROFILER_BEGIN ("size allocating");
   while (container_resize_queue)
     {
       GSList *slist;
@@ -1022,8 +1025,11 @@
       GTK_PRIVATE_UNSET_FLAG (widget, GTK_RESIZE_PENDING);
       gtk_container_check_resize (GTK_CONTAINER (widget));
     }
+  G_PROFILER_END ();
 
+  G_PROFILER_BEGIN ("process all updates ");
   gdk_window_process_all_updates ();
+  G_PROFILER_END ();
 
   GDK_THREADS_LEAVE ();
 
Index: gtk/gtkwidget.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwidget.c,v
retrieving revision 1.248
diff -u -r1.248 gtkwidget.c
--- gtk/gtkwidget.c	2001/08/11 20:27:36	1.248
+++ gtk/gtkwidget.c	2001/08/14 18:38:36
@@ -2633,6 +2633,8 @@
 gtk_widget_send_expose (GtkWidget *widget,
 			GdkEvent  *event)
 {
+  gboolean ret_val;
+
   g_return_val_if_fail (GTK_IS_WIDGET (widget), TRUE);
   g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), TRUE);
   g_return_val_if_fail (event != NULL, TRUE);
@@ -2640,8 +2642,10 @@
 
   if (event->type != GDK_EXPOSE)
     return TRUE;
-  
-  return gtk_widget_event_internal (widget, event);
+
+  ret_val = gtk_widget_event_internal (widget, event);
+
+  return ret_val;
 }
 
 static gint
Index: gtk/gtkwindow.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkwindow.c,v
retrieving revision 1.140
diff -u -r1.140 gtkwindow.c
--- gtk/gtkwindow.c	2001/08/10 15:33:29	1.140
+++ gtk/gtkwindow.c	2001/08/14 18:38:36
@@ -49,6 +49,9 @@
 #include "gtkiconfactory.h"
 #include "gtkintl.h"
 
+#define G_ENABLE_PROFILER
+#include "gdk/gprofiler.h"
+
 enum {
   SET_FOCUS,
   FRAME_EVENT,
@@ -2806,6 +2809,8 @@
   
   g_return_val_if_fail (GTK_IS_WINDOW (widget), FALSE);
   g_return_val_if_fail (event != NULL, FALSE);
+  
+  G_PROFILER_POINT ("received configure");
   
   window = GTK_WINDOW (widget);
 
Index: tests/testgtk.c
===================================================================
RCS file: /cvs/gnome/gtk+/tests/testgtk.c,v
retrieving revision 1.271
diff -u -r1.271 testgtk.c
--- tests/testgtk.c	2001/08/10 03:46:08	1.271
+++ tests/testgtk.c	2001/08/14 18:38:37
@@ -47,6 +47,8 @@
 #define sleep(n) _sleep(n)
 #endif
 
+#include "gdk/gprofiler.h"
+
 #include "circles.xbm"
 #include "test.xpm"
 
@@ -10703,5 +10705,6 @@
 	g_main_iteration (FALSE);
 #endif
     }
+  g_profiler_dump_data (stdout);
   return 0;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]