When I said batch-processing I ment processing a file or chunk of buffer (region) just before it is to be displayed to a user. Same for other "insertions" from macro expansions or similar. 

I didn't know what term to use to make less typing, sorry if it was unclear what I ment. Scrolling would probably go into same category too. I didn't ment batch-processing as in calling 3macs from shell-scripts :-). Hope it clarifies what I nent. If you have better term I m glad to use it  :-) 

With interactive I ment user typing, but it includes all edits done by user regardless by keyboard or mouse. Point was that for a small edits, a word ot two, there is probably more overhead to use threads then to do them from current thread.

I also don't think teee-sitter is needed for syntax coloring. Tree-sitter seems to be very expensive regex engine in that case. 

Skickat från min Samsung Galaxy-smartphone.



-------- Originalmeddelande --------
Från: Eli Zaretskii <eliz@gnu.org>
Datum: 2020-01-05 20:40 (GMT+01:00)
Till: arthur miller <arthur.miller@live.com>
Kopia: monnier@iro.umontreal.ca, alan@idiocy.org, emacs-devel@gnu.org
Ämne: Re: Using incremental parsing in Emacs

> From: arthur miller <arthur.miller@live.com>
> CC: "alan@idiocy.org" <alan@idiocy.org>, "emacs-devel@gnu.org"
>        <emacs-devel@gnu.org>
> Date: Sun, 5 Jan 2020 19:23:16 +0000
>
> I think there are two use-cases:
>
> 1) batch processing where entire file (or visible portion) is processed by different thread(s), for example on file
> opening or if some expansion takes place (yasnippet or similar).
>
> This can be done by dividing text in number of blocks (lines or similar) and letting each thread match block
> atva time against shared pattern database.
>
> 2) interactive use; when user is typing actively.

Maybe I'm missing something, but I don't see how any of this is
relevant to batch processing.  We never do anything in batch in an
interactive Emacs session, since the user is always there, waiting.
The display engine has many optimizations to eliminate the delays
caused by prolonged processing required to decide what should change
on the glass.  IOW, "interactive" doesn't just mean "typing", it can
mean any other command that changes what's on display, like scrolling.