Extremely high CPU usage when transmitting large signal messages
Submitted by Mike C. Fletcher
Assigned to Telepathy bugs list
Description
I have an OLPC-XO/Sugar activity which is written to use Telepathy to transmit messages between a server (one of the XOs) and the clients (2, one being the server as well). To do this it does a state update every 1/2 second.
A state update (signal) signature looks like this:
'(a(i(ii)iiai)a(i(ii)iii)a(ibiidia(ii)ai)a(isiidiii))'
With the arrays containing (roughly, depending on the game size), 20 of the first array, 209 of the second, a couple of the third (theoretically could be up to of 209 in that array), and 2 in the fourth. That is, around 1500 primitive objects, around 6 kilobytes of data per update with a resonably efficient encoding.
We're using a dbus tube object using an ExportedGObject. The networking code is primarily defined at:
When this activity is running on two sugar-jhbuild emulators on a dual-core AMD64 4800+ I'm seeing 97% of one CPU used by the telepathy-gabble process (as reported by top). This seems extremely high to me and I would class it as a failure case.
To reproduce, install the .xo linked in the URL into Sugar on two machines (or one machine with two emulators). Start the game on one machine, share it. Click on the shared game on the other machine. On the host, click start game. Once the game starts, the CPU usage on the telepathy-gabble process climbs to 97% or so.
It could be this is a usage problem (I'm relatively new to telepathy). If it is, please let me know so I can document the pitfall for other activity developers.