Ethereal-dev: Re: [Ethereal-dev] Re: Performance: change the time format for a file with 500 0

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

From: Richard Urwin <richard@xxxxxxxxxxxxxxx>
Date: Sat, 6 Dec 2003 00:10:24 +0000
On Friday 05 Dec 2003 7:26 pm, you wrote:
> On Dec 5, 2003, at 10:37 AM, Richard Urwin wrote:
> > Could you initialise the field to "unknown" and have the first thing
> > that
> > wants to know it fill it in?
>
> To which field are you referring?

> > It might be that the right way to do it would be to have the loop in
> > file.c maintain the row number itself; I *think* it should be able to
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  That one.
> > check the "flags.passed_dfilter" member of the frame_data structure to
> > see whether a particular packet is being displayed or not, and assume
> > that the Nth displayed packet has a row number of N.

I don't know the code you are refering to, so it might be inappropriate. 
But...

If file.c maintains the row number, but can't work it out by itself, it must 
call GTK to do so. But it only has to do so once, and only when it needs to. 
That would turn an O(xN^y) situation into an O(N) situation. Of course, if 
file.c can calculate the row number, that's O(1).

Another possibility would be to iterate through the list in row order and 
store the row number in the protocol tree.

Sorry, I'm probably stating the obvious.

-- 
Richard Urwin