[Lazarus] About 0013268: SynEdit parses every line twice on load or paste (Attn: Flávio)

Flávio Etrusco flavio.etrusco at gmail.com
Thu Mar 5 02:13:49 CET 2009


On Wed, Mar 4, 2009 at 8:04 PM, Martin Friebe <lazarus at mfriebe.de> wrote:
> Martin Friebe wrote:
>> Flávio Etrusco wrote:
>>
>>> On Wed, Mar 4, 2009 at 11:27 AM, Martin Friebe <lazarus at mfriebe.de> wrote:
>>>
>>>> This would mean the only Problem remaining is:
>>>> If a user writes his own code, calling Lines.Add (or even Lines.Insert)
>>>> in a loop. And does so without calling Lines.BeginUpdate before.
>>>>
>>>> While I admit that such a behaviour would add a lot of calculation
>>>> overhead, with the current SynEdit implementation, I would also see it
>>>> partly as a user error, since other Components also provide BeginUpdate
>>>> or similar Methods.
>>>> Still it should be fixed.
>>>>
>>> Calling BeginUpdate is not enough, they must disable/unset the
>>> highlighter to avoid the double parse.
>>>
>> As I said, I need to check, if BeginUpdate currently works(I haven't
>> verified, so I don't know if it does). Until that is done the bug stays
>> as it is.

Oops, only now I saw you said "once you fix the code to do load and
paste in one go".
Sorry :-$

>> *If* BeginUpdate works, then the content of my original mail should be
>> applicable.
>>
>>
>
> To avoid any misunderstanding:
>
> *If* / *Once* BeginUpdate works, then you can insert a batch of say 100
> lines (with Lines.Add or Lines.Insert). It will scan 101 lines (because
> yes, 1 line needs to be rescanned)
> I do not think we need to worry about the performance between 100 or 101
> Lines? (Not saying this may not be "fixed", but it would have a very low
> priority "post 1.2")
>
> If you insert a single line, it will scan 2 Lines. True that is not good
> neither. But it will still be so fast that no human can tell the difference.
>
> So I will fix BeginUpdate, *if* it is broken (and I will try to get that
> done for 0.9.28)
>
> But making the changes according to the original description will be
> deferred for later (unless a nice clean patch comes along).
> It may also be that it will become unnecessary due to other changes that
> may be made in future.
>
>
> Do you think fixing BeginUpdate will improve the Situation enough for now?
>
> Best Regards
> Martin

IMO this is pretty good enough, yes. (Not sure it's possible, though)
The important thing is to fix the paste performance; I didn't mean to
be pedantic with the code ;-)

Cheers,
Flávio




More information about the Lazarus mailing list