Ethereal-dev: [ethereal-dev] I hate GLists

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxx>
Date: Wed, 25 Aug 1999 20:26:51 -0700 (PDT)
Loading a 17MB trace file took forever, so I built a profiled version
and tried it.

Most of the CPU time was spent in "g_list_nth()" called by
"gtk_clist_set_foreground()" and "gtk_clist_set_background()".

Unfortunately, unlike my previous changes to get rid of that flavor of
N^2 behavior, by avoiding calls to set attributes of lines in the CList
as they're built (as those calls use "g_list_nth()"), that one doesn't
looks so easy to fix without changing GTK+.  I'll see if I can have the
CList remember the row number of the most recently added item, and a
pointer to that item, and use that as a cache to avoid calling
"g_list_nth()", or something such as that.