>>>>> "Abdelrazak" == Abdelrazak Younes <[EMAIL PROTECTED]> writes:

Abdelrazak> IMHO, this is because the code is not object oriented. In
Abdelrazak> this context docIterator is an advantage. When/if we move
Abdelrazak> to a truly object oriented way of dealing with insets I
Abdelrazak> believe that most of the its use will disappear. 

dociterator is a nice way to pass context information to an inset
instead of having the inset cache this information.

Abdelrazak> Beside updating _all_ the counters of the document
Abdelrazak> (including inside insets!) because of one new paragraph
Abdelrazak> seems wrong to me.

You are right if you never plan to add counters inside floats. Think
caption inside a float inset. Think enumeration in a footnote in an
enumeration. 

>> What would be more useful though is to see a profile so that we see
>> what the problem actually is. Rewriting everything just in case it
>> helps will not give us the solution.

Abdelrazak> This is something I don't understand, sorry. IMHO,
Abdelrazak> rewriting is a sane thing to do in any case if you want
Abdelrazak> more people to understand the code. 

I was thinking of rewriting as a way to speed up code. I _really_
would like to see gprof output about this case. We cannot guess where
the problem is without seeing it.

Now we can argue on whether we make the code more readable, but we
should not use speed as a justification until we can prove it. I can
tell you that I did gprof optimization on this code and removed the
parts that were big offenders under linux. It is not as if the code
grew a life of its own.

I agree that this code is not very nice and is very fragile. This is
in part due to the difficulty of handling paragraph depth and inset
nesting. 

Abdelrazak> There are really too much code of that sort in lyx. Please
Abdelrazak> find attached a patch that improve the situation
Abdelrazak> dramatically. 

In what sense? Speed or legibility? Is it the use of
needsUpdateCounters (should maybe be needsCountersUpdate) that helps?



Abdelrazak> The LABEL_ENUMERATE case optimization is not yet enabled
Abdelrazak> but is almost ready. Passing (Buffer const & buf) is not
Abdelrazak> nice from an OO point of view but this can be solved
Abdelrazak> later.

I still do not see what you gain versus passing a DocIterator.

JMarc

Reply via email to