[PATCH] Smart GTK GUI responsiveness

Maciej Kowalczyk mikazkow at tlen.pl
Mon Aug 27 21:51:38 PDT 2007


Hi,
I really like you package manager and would like to contribute to it.
Recently I did some work on optimizing Smart (especially suse version).
Firstly, let me describe the problem.
I'm used to working with full, non-grouped list of packages. My usual use  
case is to open smart, press Ctrl+F, write the name of package, press  
enter and so on...
It started to annoy me that if I open the search bar quickly enough I see  
standby mouse cursor for few seconds. It happens also when showing search  
bar just after closing a former one.
After some digging using lsprofcalltree.py and Kcachegrind I saw that the  
GtkInteractiveInterface.setBusy method launches gtk main loop which lasted  
long if was started shortly after showing package list.
This is caused by the fact that it has some overdue  
GtkPackageView._setPixBuf invocation (it's called at least once per  
package on the list).
To correct user experience we have two options:
- optimize _setPixBuf function (it is limited by PkgConfig.testFlag)
- somehow make it compute in background

Concerning optimization, without touching the code of SysConfig, I only  
thought of enabling Psyco optimizations for GtkPackageView._setPixbuf,  
PkgConfig.testFlag, SysConfig._getvalue, and SysConfig._traverse. However,  
resulting acceleration was not enough for me.

Next thing I tried was resigning of running gtk main loop in setBusy at  
all. As a result the hourglass wasn't visible at all during time consuming  
search operations. Also not good for user exp.

At last I tried running only one cycle of gtk main loop after showing busy  
cursor and that worked. Hourglass was visible only during search operation  
and there was no delay for updating pixbufs.
Frankly I'm not sure why this worked but nevertheless I'm sending a patch.

Maybe you or someone from the mailing list will have better idea how to  
address this problem (maybe some threading stuff?).

Looking forward to any comments.

--

Maciej Kowalczyk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smart-setBusy-dont-run-gtk-mainloop.patch
Type: application/octet-stream
Size: 481 bytes
Desc: not available
URL: <http://lists.labix.org/pipermail/smart-labix.org/attachments/20070828/020e69b6/attachment-0002.obj>


More information about the Smart mailing list