From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: HaiJun Zhang Newsgroups: gmane.emacs.bugs Subject: bug#38807: [Feature request]: Support lisp workers like web workers. Date: Tue, 24 Mar 2020 12:22:57 +0800 Message-ID: References: <83o8vpn8g1.fsf@gnu.org> <87mub9u0ld.fsf@gmx.de> <831rslmxih.fsf@gnu.org> <83lfqslafm.fsf@gnu.org> <83r20jjgg3.fsf@gnu.org> <83png1hyb8.fsf@gnu.org> <83imlrh9ze.fsf@gnu.org> <83d096dswz.fsf@gnu.org> <83lfnscvfi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="5e798b26_3fc32e20_6dce" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="67914"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 38807@debbugs.gnu.org, michael.albinus@gmx.de, yyoncho@gmail.com To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Mar 24 05:24:14 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jGb6s-000HYI-2T for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Mar 2020 05:24:14 +0100 Original-Received: from localhost ([::1]:42504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGb6q-0004yF-Mc for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Mar 2020 00:24:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58181) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jGb6h-0004y3-Gu for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2020 00:24:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jGb6g-00046w-4r for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2020 00:24:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47802) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jGb6g-00046q-1H for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2020 00:24:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jGb6f-0001g6-Ub for bug-gnu-emacs@gnu.org; Tue, 24 Mar 2020 00:24:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: HaiJun Zhang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Mar 2020 04:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38807 X-GNU-PR-Package: emacs Original-Received: via spool by 38807-submit@debbugs.gnu.org id=B38807.15850238016382 (code B ref 38807); Tue, 24 Mar 2020 04:24:01 +0000 Original-Received: (at 38807) by debbugs.gnu.org; 24 Mar 2020 04:23:21 +0000 Original-Received: from localhost ([127.0.0.1]:53775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jGb61-0001es-7b for submit@debbugs.gnu.org; Tue, 24 Mar 2020 00:23:21 -0400 Original-Received: from mail-oln040092254104.outbound.protection.outlook.com ([40.92.254.104]:41952 helo=APC01-PU1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jGb5y-0001eb-H8 for 38807@debbugs.gnu.org; Tue, 24 Mar 2020 00:23:19 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ONSxfkVlBYpJ+o6IDOBU5v4olJaDGXr1CguKrM8ku9oVkAZv+giVOySFJBEDs7H6+GnW5ED9+svappJVdGncGVsFjNjKTxgALZJ+9gj5QkvOKtg7xt93wocHjzzHPUagOzQ9cnYoH0GjDQzO9DPV/gMHi49ZikY8NxLIa8mv2kZEO35TUf/qIVLWNYVEPpI0gDze5z3T4ORxX4xhA9jULHtfVHutre0yRy5IGK8h6RNHsz8TkYuIxEyt+N4CkQrWQz5dnf/O6YX/N43TkWPa3jP4fFmMmUS4fQyAvgNuBFIqg6y8oVGcsVVdJnnfVDk7C5kDYWnJZjzDI+ehFUFZzQ== 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=ZN1fm99hBnx8sqbhNB+Z1cE7zXsHds8XJLPZL/dkIdY=; b=B91CWIETR2wAXDRSJlDlxJ4FwOy8kxCuYMhjF5Og5hB/12rDyjqYoFR6mZRmWJGLXSN3orSKr3Ff7646qNY/c7jF81qqTYRTxPt4n/c2ZOHjw4LZP3ZRxsU66XarkM50lK2cf/edGGED52ofenBmIisP/iUYP661C2wYQj1BpYt2QwzJVkRvxiD0r0+6XAWhzFwL64Nrrzl76mSmTgrO7e5Hzn6H2UPKKm6GkHfHtgWbeTZ9FyjPEVVDTA7NWuX/TyEWE/JSrG2Kyz7lbaMjYriKEJnTyFDzZlGaqDXCdKGeGMOZ28ba03o049ootO+qeFaJYyr/XdCb7N8qvIhDWA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ZN1fm99hBnx8sqbhNB+Z1cE7zXsHds8XJLPZL/dkIdY=; b=gEX8RQcFIcXh5NB/EhzpzRxq4DfYqsMBC1fAw1gerUq1dVvy/NqwxWyfBPMBHRe0EBcNei7VphoKO93+XieZk7CdXZ8zonXgbF7PnlPAG2kuo3WYKfZPFnx4mmFdwnUwsDCoponlU3gtmzvDzUe3FDdKoQnf7VtoikEGR6ijOUizANQay2JgfkcJUhQab8u+MY0S0IWt7Q26cc5QXwmM/uk/yI3eHmbOPoByi63Z127+IZKikEbgenuPSKBh08u/1nccDciTL5RwDLW2bfXxXKJS4tnRRG/Cl+fpwH5yHgTWzocV4kw9wec9vnrC7WvuT9R8f2/5o0ddRE+Tme4d0Q== Original-Received: from SG2APC01FT051.eop-APC01.prod.protection.outlook.com (2a01:111:e400:7ebd::3c) by SG2APC01HT119.eop-APC01.prod.protection.outlook.com (2a01:111:e400:7ebd::346) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.13; Tue, 24 Mar 2020 04:23:09 +0000 Original-Received: from PS1PR03MB3606.apcprd03.prod.outlook.com (10.152.250.56) by SG2APC01FT051.mail.protection.outlook.com (10.152.251.112) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.13 via Frontend Transport; Tue, 24 Mar 2020 04:23:09 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:626A3A21C8B3DA78D125706F37032F5FF25BBD97E957808799B28BB3BA55FCCF; UpperCasedChecksum:1A3AA058F70F537A7D9C379E980743E8BA8566DED341269E7736247D4BFC05E1; SizeAsReceived:9590; Count:49 Original-Received: from PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::85cb:c430:1173:7716]) by PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::85cb:c430:1173:7716%5]) with mapi id 15.20.2835.021; Tue, 24 Mar 2020 04:23:09 +0000 In-Reply-To: <83lfnscvfi.fsf@gnu.org> X-Readdle-Message-ID: 69de1f08-2108-4758-9043-12b8b5e162ce@Spark X-ClientProxiedBy: HK2P15301CA0021.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::31) To PS1PR03MB3606.apcprd03.prod.outlook.com (2603:1096:803:4e::17) X-Microsoft-Original-Message-ID: <69de1f08-2108-4758-9043-12b8b5e162ce@Spark> X-MS-Exchange-MessageSentRepresentingType: 1 Original-Received: from [192.168.1.150] (1.196.184.53) by HK2P15301CA0021.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.5 via Frontend Transport; Tue, 24 Mar 2020 04:23:08 +0000 X-Readdle-Message-ID: 69de1f08-2108-4758-9043-12b8b5e162ce@Spark X-Microsoft-Original-Message-ID: <69de1f08-2108-4758-9043-12b8b5e162ce@Spark> X-TMN: [/wuSkHO3n0C6PJtccHuqBNJXHmOUmKZa] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: d3183087-5db0-4805-f12b-08d7cfab0eef X-MS-TrafficTypeDiagnostic: SG2APC01HT119: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0hdDYjD+dFvicxeN0faahoik6RzF2KHoKRE6du0l21kUU0zBBFpVpcupBN/xfkSRSNHzdrvI3TngkTvkMFyn12cs/aJ0jy1rcBwyY4i3x+jnrNWSJg3M8vBjY/Ky93uGoNUKJxmbBmgs1p3ksakRv9/zW+vEPl9T/BWRcnAZU2wfLqDZHhZk2YjgiGo27lrs X-MS-Exchange-AntiSpam-MessageData: dBuFHBS+d9QaphK7gdW/sZ+NnsyU9+wbhIwKLauxZeuScuAUUVG6QjI6IvbK/h/tu4/pd7t0NSlnY5GQjZ6wucWbA+KRIcz6y1Ut1rp/+WcFmERe00Ae4um6vHVSlcmaaEBlyiEbaSGV60X6tcdO8g== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3183087-5db0-4805-f12b-08d7cfab0eef X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2020 04:23:09.6955 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2APC01HT119 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:177669 Archived-At: --5e798b26_3fc32e20_6dce Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =E5=9C=A8 2020=E5=B9=B43=E6=9C=8822=E6=97=A5 +0800 PM10:32=EF=BC=8CEli Za= retskii =EF=BC=8C=E5=86=99=E9=81=93=EF=BC=9A > > Suppose a module thread will be able to parse JSON: what would the > main (a.k.a. =22Lisp=22) thread of Emacs do while the module thread is > working=3F Doesn=E2=80=99t it need to wait for the parsed data anyhow=3F= > They don=E2=80=99t known each other. It will be good if module thread can= post message to lisp thread. It will be better if module thread can send= lisp data within the message to lisp thread. > > > If json messages are parsed in module thread and saved as c struct da= ta(not lisp data), they have to be > > translated to lisp data before emacs use. The translation which shoul= d be done in emacs thread cost too > > much cpu, which make the parallel parsing of json messages not very u= seful. > > You are saying that the translation is costly, but did someone > actually measure that and verify that it's indeed costly=3F And if > someone did, where can I see the results in sufficient level of detail > to understand what part(s) of parsing JSON are the bottleneck=3F > I have talked with the author of lsp-mode. I think their team have done s= ome work on this. =40yyoncho=C2=A0Can you join the discussion=3F > > Is it possible to parse json messages and prepare data struct for pdu= mper, and translate the data to lisp > > using pdumper=3F What about the performanse comparing with the above=3F= > > I don't think I understand what does pdumper have to do with this > issue. My understanding is that pdumper can serialize and deserialize lisp data.= Maybe we can prepare data with its format and let it deserialize them. --5e798b26_3fc32e20_6dce Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
=E5=9C=A8 2020=E5=B9=B43=E6=9C=8822=E6=97= =A5 +0800 PM10:32=EF=BC=8CEli Zaretskii <eliz@gnu.org>=EF=BC=8C= =E5=86=99=E9=81=93=EF=BC=9A

Suppose a module thread will be able to parse JSON: what would the
main (a.k.a. "Lisp") thread of Emacs do while the module thread i= s
working? Doesn=E2=80=99t it need to wait for the parsed data anyhow?


They don=E2=80=99t known each other. It will be good if m= odule thread can post message to lisp thread. It will be better if module t= hread can send lisp data within the message to lisp thread. 



If json messages are p= arsed in module thread and saved as c struct data(not lisp data), they have= to be
translated to lisp data before emacs use. The translation which should be d= one in emacs thread cost too
much cpu, which make the parallel parsing of json messages not very useful.=

You are saying that the translation is costly, but did someone
actually measure that and verify that it's indeed costly? And if
someone did, where can I see the results in sufficient level of detail
to understand what part(s) of parsing JSON are the bottleneck?


I have talked with the author of lsp-mode. I think their = team have done some work on this.

@yyoncho Can you join the= discussion?



Is it possible to pars= e json messages and prepare data struct for pdumper, and translate the data= to lisp
using pdumper? What about the performanse comparing with the above?

I don't think I understand what does pdumper have to do with this
issue. 

My understanding is that pdumper can serialize and deserialize lisp da= ta. Maybe we can prepare data with its format and let it deserialize them.<= /div>

--5e798b26_3fc32e20_6dce--