From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: arthur miller Newsgroups: gmane.emacs.devel Subject: RE: Using incremental parsing in Emacs Date: Sun, 5 Jan 2020 20:28:43 +0000 Message-ID: References: <83blrkj1o1.fsf@gnu.org> <20200105141900.GA71296@breton.holly.idiocy.org> ,<83eewdg3vy.fsf@gnu.org> , <834kx9g08y.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_VI1P194MB04291027CFC3340E4F66DAB6963D0VI1P194MB0429EURP_" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="248994"; mail-complaints-to="usenet@blaine.gmane.org" Cc: "alan@idiocy.org" , "monnier@iro.umontreal.ca" , "emacs-devel@gnu.org" To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 05 21:29:51 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ioCX0-0012eS-Ox for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2020 21:29:50 +0100 Original-Received: from localhost ([::1]:45050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioCWy-0002YT-I4 for ged-emacs-devel@m.gmane.org; Sun, 05 Jan 2020 15:29:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55004) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioCW3-00026f-OP for emacs-devel@gnu.org; Sun, 05 Jan 2020 15:28:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioCW2-0002FB-0N for emacs-devel@gnu.org; Sun, 05 Jan 2020 15:28:51 -0500 Original-Received: from mail-oln040092066079.outbound.protection.outlook.com ([40.92.66.79]:9957 helo=EUR01-VE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ioCVy-0002CL-4D; Sun, 05 Jan 2020 15:28:46 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jRQvWcaST/Bpy/VJV+Jfw00Gp0ra1PZpTa4LRl7NclTZ8zWWdrzhukseqeTSrQpJWqxsB9/IpHipoa5VRuklNuzI6LOkpYwfo3jICF7WbV/oYRC2LqCpgLHI155NWqvgaCEEf1flkO9FNji0Q/IE/VHIok1klXIChpe9a7vUVl+mFdx8YZvoTJ8iuaZcFkz/5GONlFWGFmVp6HJPbouObWfPDyChbBU+HiCj20S/Fsdw3S7HX9J15L7ImbBuA2c0+MuSZukjYfd4mAJD9G+jPG71UA+MvEHQ/RimRf6aj0O6lPCnW6vRpfOZ2bsATsCJgNnnXz64/ZzKTyIAVSKk3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SQFtHSUYnRzQoA73uKl/HaAK7cW390cIOLKfE8W3FrY=; b=cPI0TDViP/WrlnQmEqpFTbozM6Dof/PDuN21RARvScNjWjxBmPHucT57/qHs1DfxkwQqmK0q9KZ497FbfVfhM1bUOXMDBpmrw2VD+GIRmpuTtidBK41hA4P9+AoaxovwNYuoFyWDuKxXOEa5cv/fBc0j3ToS2JH/If+LF/i3x+9Swh1V8Kr3vBqw8PNWl0JV+uFE4M1sREKjxXogaVRnGPtwN7XrR5H+j8eULm6iP0978q5Z4LKe1uIKT2z6Hcafy8PfZMW/au/E/ERIF8p5AIe90FAZnxdsuUJv7PPQyhRND2sXu7ep1yfe1uBfJ0SkelhmfnijB3wPVXZ6yTFe4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SQFtHSUYnRzQoA73uKl/HaAK7cW390cIOLKfE8W3FrY=; b=tvttGHgRY5gElswvBzDNPrwYX34LhF0TK35IN/bYxw2sHF08B6Efb6lePTz9fKHAugMO9rpV9VajqE2IlHK9bALDbrwUh20HDj99DsB6ImN0UXFa9CZiCaHCMVyixGDnLddq6KfBFS0MJqqVynbMflu2YiqAB9VdubAgPqDF9E7eoXvhtTP2/FxZtTWSiTlhaW8zHuRclRLbyn6VBr6pUM68uuUlgENHDcALoP0kuU2YTekTnnX0AwsvJzx1WFmBXJOI9w9T4L5EnNp7gIDWQA14L9hFypuN3vTUpRDKDg8/wdRkzRiVFh2CDOj9rcFPUpOmpfnyiYmYamQH5/Si+A== Original-Received: from VE1EUR01FT032.eop-EUR01.prod.protection.outlook.com (10.152.2.60) by VE1EUR01HT175.eop-EUR01.prod.protection.outlook.com (10.152.3.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11; Sun, 5 Jan 2020 20:28:44 +0000 Original-Received: from VI1P194MB0429.EURP194.PROD.OUTLOOK.COM (10.152.2.55) by VE1EUR01FT032.mail.protection.outlook.com (10.152.2.222) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.11 via Frontend Transport; Sun, 5 Jan 2020 20:28:44 +0000 Original-Received: from VI1P194MB0429.EURP194.PROD.OUTLOOK.COM ([fe80::35f2:9ea2:efd6:1d46]) by VI1P194MB0429.EURP194.PROD.OUTLOOK.COM ([fe80::35f2:9ea2:efd6:1d46%5]) with mapi id 15.20.2602.015; Sun, 5 Jan 2020 20:28:44 +0000 Thread-Topic: Using incremental parsing in Emacs Thread-Index: AQHVwh1Uy8tVxqoXLEaWXDDoUSKGMKfa+yPXgAEmyACAAC+sCIAAFFzvgAAQ+pCAAATrZYAADV9c In-Reply-To: <834kx9g08y.fsf@gnu.org> Accept-Language: sv-SE, en-US Content-Language: sv-SE x-incomingtopheadermarker: OriginalChecksum:3F9B3D19336BA2F7C6B287E32276A41D0BAD2BB1A542C0D7812D5160C111A7CC; UpperCasedChecksum:BA9E3E220014D01728F5E549E76ED4356B3635E888A9116B16BC83099C3B5946; SizeAsReceived:7222; Count:46 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [MtKgcREQUyEWDZJdnEkOV5kE76Sk25gJ] x-ms-publictraffictype: Email x-incomingheadercount: 46 x-eopattributedmessage: 0 x-ms-office365-filtering-correlation-id: 5f6ef641-8a7d-4307-17f7-08d7921ddc18 x-ms-traffictypediagnostic: VE1EUR01HT175: x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 70cbFFfeHIjAcv1IH1EIN/DwvrHTPmxdWsLKS+Orf0+lvGqIrlL2T50zgsn4luOT97fcv+uVKvDlFwsOtwbCA8SS116fwfYP+rpPTKvELmg6Ts9sXYQlw5QQn/FOVfz02Z+sVitkV5RzjT6LsZOLYCv48blVu3SMArZRRc4RsjvBslHR9FBstx11tQu5JNu1 x-ms-exchange-transport-forked: True X-OriginatorOrg: live.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 5f6ef641-8a7d-4307-17f7-08d7921ddc18 X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2020 20:28:44.0128 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1EUR01HT175 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.92.66.79 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:244000 Archived-At: --_000_VI1P194MB04291027CFC3340E4F66DAB6963D0VI1P194MB0429EURP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable When I said batch-processing I ment processing a file or chunk of buffer (r= egion) just before it is to be displayed to a user. Same for other "inserti= ons" 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 c= larifies 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 s= eems to be very expensive regex engine in that case. Skickat fr=E5n min Samsung Galaxy-smartphone. -------- Originalmeddelande -------- Fr=E5n: Eli Zaretskii Datum: 2020-01-05 20:40 (GMT+01:00) Till: arthur miller Kopia: monnier@iro.umontreal.ca, alan@idiocy.org, emacs-devel@gnu.org =C4mne: Re: Using incremental parsing in Emacs > From: arthur miller > CC: "alan@idiocy.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 b= y 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. --_000_VI1P194MB04291027CFC3340E4F66DAB6963D0VI1P194MB0429EURP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
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 categ= ory too. I didn't ment batch-processing as in calling 3macs from shell-scri= pts :-). 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 sm= all edits, a word ot two, there is probably more overhead to use threads th= en to do them from current thread.

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

Skickat fr=E5n min= Samsung Galaxy-smartphone.



-------- Originalmeddelande --------
Fr=E5n: 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 =
=C4mne: Re: Using incremental parsing in Emacs

> From: arthur miller <arthur.miller@live.co= m>
> CC: "alan@idiocy.org" <alan@idiocy.org>, "emacs-d= evel@gnu.org"
>        <emacs-devel@gnu.org><= br> > 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 processe= d 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 simila= r) 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 "ty= ping", it can
mean any other command that changes what's on display, like scrolling.
--_000_VI1P194MB04291027CFC3340E4F66DAB6963D0VI1P194MB0429EURP_--