Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [xtext-dev] Re: [Bug 269989] [Highlighting] Syntax highlighting is very slow

Sure. Actually Sebastian implemented it, but that doesn't matter.
I just wanted to point out that we have to be careful when asking for read request in UI-Thread, because this will trigger the Reconciler to update the model, which will lock the access to the model and therefore freezes the UI.

It's a bit complicated but to make it short:
- It's ok to read from the model when the process is triggered by a model change event or even more coarse grained events (like it's done in the outline view) - It's not so good to read the model when triggered from more fine grained events (e.g. document change)

Cheers,
Sven

On May 13, 2009, at 4:28 PM, Peter Friese wrote:

On additional remark:
We need to be careful to avoid reading model state within the UI
thread, at
least if it is not triggered by ModelChangeEvents (like e.g. in
content
outline), because a read access will trigger the Reconciler to do his
job
(through the Processor hook). So in the case of the previous
implementation of
the DamageRepairer, which requested read access to the model, the
Reconciler
was actually triggered by the DamageRepairer's read request, which
results in a
model change on key stroke rather than the desired delayed
reconciling
strategy.

I believe this had been built in deliberatedly in order to make sure we have a valid model as soon as the user invokes CA. I think Michael can comment on this, as he had been working on this back then.

Peter

_______________________________________________
xtext-dev mailing list
xtext-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/xtext-dev



Back to the top