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: Guy Harris <guy@xxxxxxxxxx>
Date: Thu, 26 Aug 1999 23:24:47 -0700 (PDT)
> 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()".)