>>>>> "Juergen" == Juergen Vigna <[EMAIL PROTECTED]> writes:

Juergen> On 13-Nov-2000 Jean-Marc Lasgouttes wrote:
>>  You could maybe remember whether the cell is indeed the largest in
>> the column. Otherwise a redraw will not be needed. I'll see if I
>> can do a bit of profiling today.

Juergen> It seems obvious ;). The insettabular decides if a change
Juergen> occured and it's the insettabular who decides if it should
Juergen> redraw all or just a part.

Juergen> I just remember something VERY IMPORTANT:

Juergen> All of the above is ONLY valid if the tabular is in it's own
Juergen> row!!!

When looking at a profiler output (pixie on Tru64 unix) when inserting
a _lot_ of characters in a variable width cell, I see two main things:

 - things related to the buffer cache (let's assume for now we cannot
   avoid those)

 - a bunch of things are related to
   InsetTabular::getMaxWidth(Painter,UpdatableInset). 

The second one seems bad to me. Tell me if I understand correctly what
happens: when trying to see what is the width of the different cells,
the code (in tabular.C?) looks at each cell one after the other, and
calls UpdatableInset::getMaxWidth on the text inset. This goes to
LyXTabular::getMaxWidth, which searches all the tabular to find the
cell of the inset (which we knew from the start, but is however
O(nbcells)), and then finds the info we need from the cell_info
struct.

What I do not understand here is why we really need to do all these
things (in my example, LyXTabular::getMaxWidth is called 217592, al
all I did was insert maybe a hundred of 'h' in a 5x11 tabular).
Presumably, when looking at a cell, we know the maxwidth without
looking at all at the inset, since everything is in the cell_info.

I'd be interested to know more about how this works (I do not see
clearly where the invocation happens).

JMarc

Reply via email to