Signal dispatching slowed down after upgrade



Hi all,
in the last weekend I upgraded my computer to the new stable version of Debian (version 6.0.0, released a few days ago). After the upgrade, a gtkmm program of mine has become less responsive to the point of being barely usable. Apparently the dispatching of signals is now much slower than it used to be, and when a lot of them are connected (in my program there are more than 100), it becomes very noticeable.

I've built a minimal test case (attached). In this program there is a table containing many cells, and the cell which contains the mouse pointer must be activated (only one cell can be active at a time). Thus I specialized Cell::on_enter_notify_event to emit a signal, and connected the signals from all cells to a method of the main window. As an illustration, in this example the color of the active cell is set to blue; that of cells in the same row or column to green; and that of other cells to red.

It works, but there is a significant delay between my moving the pointer and the cells changing colors. The delay increases with the number of cells: with 400 cells as in the attached example, it takes about 3 seconds on my computer when I move the pointer from one cell to a neighboring one. Even worse, if I move the pointer over many cells, the delays add up: for example, if I move it by 10 cells, nothing happens until after 30 seconds. During that time the program is unresponsive: if I try to close it, Gnome pops up its "application not responding, wait or force quit" dialog.

I tried this back on the previous version of Debian (version 5.0.0) using a live cd. There it is MUCH faster: when moving the pointer by 10 cells, the delay is only about 1 second instead of 30. So this is definitely a regression.

I don't know where the problem actually lies: it could be sigc++, gtk+, the x.org server... What do you think? Can you please at least check whether my gtkmm program is coded correctly and isn't being slowed down by some bad settings? Or could you suggest another way to find which cell the pointer is in that doesn't require connecting 400 signals, other than calculating it from their coordinates?

Thank you
 Gerardo

Attachment: cells.cc
Description: cells.cc



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