Ethereal-dev: Re: [Fwd: [ethereal-dev] Fun with performance]

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

From: John McDermott <jjm@xxxxxxxxxx>
Date: Fri, 27 Aug 1999 08:41:48 -0600
Oh, you're right (of course).  I had to do that in case the filters
changed and some protocol did not get selected for colorization, but was
in the previous try.  I forgot.

--john


Guy Harris wrote:
> 
> > The calls to gtk_clist_set_{fore,back}ground (which call the
> > time-consuming g_list_nth) are only called when a filter matches
> 
> Nope.  The code in "add_packet_to_packet_list()" does:
> 
>         if (cf->colors->color_filters && (color != -1)){
>                 gtk_clist_set_background(GTK_CLIST(packet_list), row,
>                    &(color_filter(cf,color)->bg_color));
>                 gtk_clist_set_foreground(GTK_CLIST(packet_list), row,
>                    &(color_filter(cf,color)->fg_color));
>         } else {
>                 gtk_clist_set_background(GTK_CLIST(packet_list), row,
>                    &WHITE);
>                 gtk_clist_set_foreground(GTK_CLIST(packet_list), row,
>                    &BLACK);
> 
>         }
> 
> so it'll call "gtk_clist_set_{fore,back}ground()" no matter what.
> 
> (Fortunately, it appears that by tweaking the GtkCList code, you can
> eliminate the call to "g_list_nth()".)

-- 
John McDermott jjm@xxxxxxxxxx
Writer and Computer Consultant
J-K International, Ltd.
+1 505/377-6293 - V
+1 505/377-6313 - F