Ethereal-cvs: [ethereal-cvs] cvs commit: ethereal packet.h summary.c file.c file.h ethereal.c
guy 1999/08/09 23:13:41 CDT
Modified files:
. packet.h summary.c file.c file.h
ethereal.c
Log:
Building a GList by adding elements to the end with "g_list_append()" is
N^2 in the ultimate size of the list (as "g_list_append()" is linear in
the size of the list, at least when used in the way the GLib
documentation says to use it); instead, maintain our own linked list of
"frame_data" structures for all packets read, including a pointer to the
last element.
"gtk_clist_set_row_data()" is linear in the row number, so if it's used
to attach a pointer to the "frame_data" structure for a packet to the
packet list GtkClist row for each packet, that's also N^2 in the number
of packets in that packet list; instead, store the row number in the
"frame_data" structure, and find the packet for a given row by scanning
the list for it (we were already scanning the list linearly to find that
packet's index in the list of all packets; that's only done when a
packet's selected, so it's not *too* bad, but it might be nice to avoid
having to do that scan).
Revision Changes Path
1.80 +3 -1 ethereal/packet.h
1.8 +5 -7 ethereal/summary.c
1.59 +92 -101 ethereal/file.c
1.27 +3 -2 ethereal/file.h
1.78 +2 -1 ethereal/ethereal.c