Large chat room performance again

Fredrik Tolf fredrik at dolda2000.com
Sun Apr 15 00:34:50 EDT 2007


On Sat, 2007-04-14 at 18:31 +0200, Fredrik Tolf wrote:
> I've gotten my previous issues to work now, but there seems to be a
> performance issue with the GTK user list when the user count is ~10000.
> In my attempts to profile it, I compiled beta6 with debug flags and
> interrupted it at some points with gdb. The majority of the interrupts,
> it wasn't possible to get a good stack trace (since the code was running
> deep in Gtk/Pango which weren't compiled with debugging), but the times
> I did get a reliable trace, it seemed to be running in
> gtkconv.c:sort_chat_users(), which seems called by a autosorting
> GtkListStore.

I just thought I'd follow this up with some quantitative data that I've
collected. I added some logging to print the time it took to add or
delete a user, and went to a couple of chatrooms of differing sizes
(from ~500 users up to 9000), and collected the times in a diagram by
gnuplot. Here they are, in EPS format:

<http://www.dolda2000.com/~fredrik/doldaconnect/au.ps>
<http://www.dolda2000.com/~fredrik/doldaconnect/du.ps>

"au.ps" for add user, and "du.ps" for delete user. The X axis is the
number of users, and the Y axis is the time of the operation in seconds.
The boxes are centered on the average time, extends to one standard
deviation in each direction, and the lines from the boxes extend to the
minimum and maximum times. I added a line plot between the average
points to make it easier to see how the operations scale on the number
of users.

To my surprise, it does seem to scale linearly. I had guessed that it
scaled badly and that was why it went bad with larger and larger rooms,
but it seems that it just needs to be optimized somewhere. I guess I'll
need to try callgrind after all.

Fredrik Tolf





More information about the Devel mailing list