From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aaron Jensen Newsgroups: gmane.emacs.bugs Subject: bug#24048: 25.0.95; syntax-ppss can be slow Date: Mon, 25 Jul 2016 07:12:42 +0000 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c04a0d23acfc105387083cc X-Trace: ger.gmane.org 1469430806 7659 80.91.229.3 (25 Jul 2016 07:13:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 Jul 2016 07:13:26 +0000 (UTC) To: Dmitry Gutov , 24048@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 25 09:13:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bRa4f-0004Mo-ED for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Jul 2016 09:13:13 +0200 Original-Received: from localhost ([::1]:59014 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRa4e-0002Kx-Jf for geb-bug-gnu-emacs@m.gmane.org; Mon, 25 Jul 2016 03:13:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53366) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRa4Y-0002IS-B5 for bug-gnu-emacs@gnu.org; Mon, 25 Jul 2016 03:13:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRa4U-0005XA-0Z for bug-gnu-emacs@gnu.org; Mon, 25 Jul 2016 03:13:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:52154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRa4T-0005X6-SV for bug-gnu-emacs@gnu.org; Mon, 25 Jul 2016 03:13:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bRa4T-0004ax-Mf for bug-gnu-emacs@gnu.org; Mon, 25 Jul 2016 03:13:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Aaron Jensen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Jul 2016 07:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 24048 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 24048-submit@debbugs.gnu.org id=B24048.146943078017656 (code B ref 24048); Mon, 25 Jul 2016 07:13:01 +0000 Original-Received: (at 24048) by debbugs.gnu.org; 25 Jul 2016 07:13:00 +0000 Original-Received: from localhost ([127.0.0.1]:36258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRa4S-0004ai-3A for submit@debbugs.gnu.org; Mon, 25 Jul 2016 03:13:00 -0400 Original-Received: from mail-it0-f48.google.com ([209.85.214.48]:35234) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bRa4Q-0004aU-F3 for 24048@debbugs.gnu.org; Mon, 25 Jul 2016 03:12:58 -0400 Original-Received: by mail-it0-f48.google.com with SMTP id u186so78804227ita.0 for <24048@debbugs.gnu.org>; Mon, 25 Jul 2016 00:12:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=9uFEWcn7modH+h2pBeP/bJN64C29CqKb7P1voQFkO7Y=; b=A9i3H/+yA/sfuXTo258r4BrhHAGjozKKBNEPtWqTFe+IbgtEwLZzUhBh8n82i61h8K Txl+ASnuxJ4W9+3Deig0VWjAeHJ+JqDBmneN1d76kKBx5GVOiCcbvNz8tkatYjjJO4om plo+RJ3x1pvgiNL0arJVmBrR1SLhqoZI1zqzHYiq/KMbnRYKkBd89IROS/xs3PreJoVU B9/dxQNzY+azp+e7W5KzfhNSMaD1u0eRPN6P0aILGE+UGJwL4T+j/PfDZhEtA87CujFw egfymvkYfZk6vo809qe7suY2yFlwZyliitVp04qV/cXrRPB04c/vhDcCKU4O0yIvshYl 1hWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=9uFEWcn7modH+h2pBeP/bJN64C29CqKb7P1voQFkO7Y=; b=bnoAJvaYX4tbxznwi1FPuZ8jyj6WeMWuJ0sZsKNT9qDEmtlhBDzjh7sYxQw06svXN+ 6aksaMv83bxmE02zhudKh2XXwTArZL/ltt+v7JzimVTmRFst+wf7B+oIcIPraWahh8Gm wTAp7mBdAIJyu4i7l5UR8KHZPFjUgCRMb20FL/NSyudm40/5cpqjYqYo3W8lz9fiqHEN hpUq3QaWuZdmglFYHSWhyjbc4++igkPm89pKKAv+TBdUd8dV6EQNzpAvGKtE5Txv9wqa dnGfa03ZL9TdB5updj8FFcLIedL7pX+18FAhaG1CdI9ZZcWb9MDS6jIV4H01NqmemTO8 /udw== X-Gm-Message-State: AEkoouuGRYboaSbIHkSA9ZqBjagAgbRWcTgCNkaGcrUnJ0R0CHRI15L77Hf4821tPn3fsi0F+6AnUdlnLAS+TA== X-Received: by 10.36.142.129 with SMTP id h123mr19432661ite.66.1469430772710; Mon, 25 Jul 2016 00:12:52 -0700 (PDT) In-Reply-To: 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: 208.118.235.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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121509 Archived-At: --94eb2c04a0d23acfc105387083cc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Dmitry, On Sun, Jul 24, 2016 at 6:16 PM Dmitry Gutov wrote: > Is there a way to reproduce it more easier? Maybe without smartparens, > just with elixir-mode, if it's sufficient to illustrate the performance > problem (I recall you stating parse-partial-sexp is also unusually slow > in that major mode, for some reason). > Sure, just use elixir-mode and this file https://gist.githubusercontent.com/aaronjensen/d4cd40347a916dd36c8239afecf6= 4a7d/raw/b52440bb51b96193a365a7f4cc1c8733ba98476f/syntax-ppss-slow-repro.ex Then do: (benchmark 100 '(syntax-ppss)) at the top of the file and compare it to doing it within the `chunk_by` function at the bottom of the file. For me it=E2=80=99s 0.2ms at the top and 5.6ms at the bottom. Smartparens c= an do 50-100 syntax-ppss calls for every self-insert-command, and 5.6ms is significant latency to add on to every keypress. I have a proposed pull to get smartparens to memoize syntax-ppss itself https://github.com/Fuco1/smartparens/pull/629 but in theory it should be redundant given syntax-ppss=E2=80=99s built in caching. P.S. Please send a text email next time, we very much prefer them for > various reasons, inability to sneak in a tracker like this among them: > Unfortunately, modern email clients don=E2=80=99t really offer this as an o= ption anymore. I started to set up mu4e but it just became too much work to set up for the sole purpose of being able to send text emails to report emacs bugs. This probably isn=E2=80=99t the place to debate the merits of easy fo= r most people to use bug reporting. src=3D3D=3D22h=3Dttp:// > pixels.canarymail.io/tracking/07C7B5E0-9441-40AD-9CC3-D2A176741827.=3Dpng= =3D22 > id=3D3D=3D22141121424AC1=3D466A74CBB8A45B347C37B=3D22 style=3D3D=3D22widt= h: 1p=3Dx; > height: 1px;=3D22> > Yeah, canary isn=E2=80=99t even the client I=E2=80=99m using anymore, it=E2= =80=99s just what emacs happened to open when I told it to open my email client to send the bug report. Unless Inbox is doing its own weirdness this mail should be tracking pixel free. --=20 Aaron --94eb2c04a0d23acfc105387083cc Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Dmitry,

On Sun, Jul 24, 2016 at 6:16 PM Dmitry Gutov <dgutov@yandex.ru> wrote:
Is there a way to reproduce it more easier? Maybe without smartp= arens,
just with elixir-mode, if it's sufficient to illustrate the performance=
problem (I recall you stating parse-partial-sexp is also unusually slow
in that major mode, for some reason).

Then do:=C2=A0(benchmark 100 &#= 39;(syntax-ppss)) at the top of the f= ile and compare it to doing it within the `chunk_by` function at the bottom= of the file. For me it=E2=80=99s 0.2ms at the top and 5.6ms at the = bottom. Smartparens can do 50-100 syntax-ppss calls for every self-insert-c= ommand, and 5.6ms is significant latency to add on to every keypress.=C2=A0=

I have a proposed pull to get smartparens to memo= ize syntax-ppss itself=C2=A0https://github.com/Fuco1/smartparens/pull/629=C2=A0but in th= eory it should be redundant given syntax-ppss=E2=80=99s built in caching.

P.S. Please send a text email next time, we very much prefer them for
various reasons, inability to sneak in a tracker like this among them:
<= /blockquote>

Unfortunately, modern email clients don=E2= =80=99t really offer this as an option anymore. I started to set up mu4e bu= t it just became too much work to set up for the sole purpose of being able= to send text emails to report emacs bugs. This probably isn=E2=80=99t the = place to debate the merits of easy for most people to use bug reporting.

<img
src=3D3D=3D22h=3Dttp://pixels.canarymail.io/tracking/07C7B5E0-9441-40AD-9CC3-D2A176741827.= =3Dpng=3D22
id=3D3D=3D22141121424AC1=3D466A74CBB8A45B347C37B=3D22 style=3D3D=3D22width:= 1p=3Dx;
height: 1px;=3D22>

Yeah, canary isn= =E2=80=99t even the client I=E2=80=99m using anymore, it=E2=80=99s just wha= t emacs happened to open when I told it to open my email client to send the= bug report. Unless Inbox is doing its own weirdness this mail should be tr= acking pixel free.
--
Aaron
--94eb2c04a0d23acfc105387083cc--