OOPS, forgot to copy this to the list.
--john
John McDermott wrote:
>
> Jeff,
> The algorithm is: compare each filter to the "current packet". If it is
> a match, record the number of the filter in a variable (say, f). After
> all the comparison is done, apply filter f.
>
> Yes, if I applied the first filter that would probably be faster for
> large lists of filters. Now, the number of comparisons is fixed at F * n
> where F is the number of filters and n is the number of packets. Your
> suggestion might reduce the number of comparisions to (F*n)/2 on
> average. In either case, the entire list must be processed.
>
> The calls to gtk_clist_set_{fore,back}ground (which call the
> time-consuming g_list_nth) are only called when a filter matches so I
> suspect the improvement would be minimal if the algorithm for
> colorization were changed. Just a guess.
>
> --john
>
> Jeff Jahr wrote:
>
> > On the subject of performance, I believe [1] that the color filter
> > code is set up to always try and apply each color filter in the list to
> > each packet being decoded.
> >
> > Changing that function to 'the first matching color filter in list
> > is the one applied' from 'all matching color filters are applied in order'
> > would be good optimization with no loss of functionality...
> >
> > -jsj
> >
> > [1] as in, I have not checked the code, only observed its behavior.
>
> --
> John McDermott jjm@xxxxxxxxxx
> Writer and Computer Consultant
> J-K International, Ltd.
> +1 505/377-6293 - V
> +1 505/377-6313 - F
--
John McDermott jjm@xxxxxxxxxx
Writer and Computer Consultant
J-K International, Ltd.
+1 505/377-6293 - V
+1 505/377-6313 - F