unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Aaron Jensen <aaronjensen@gmail.com>
To: Dmitry Gutov <dgutov@yandex.ru>, 24048@debbugs.gnu.org
Subject: bug#24048: 25.0.95; syntax-ppss can be slow
Date: Mon, 25 Jul 2016 07:12:42 +0000	[thread overview]
Message-ID: <CAHyO48ywOJY8F7=bJbEPA9mcN1WnZx56fQzbzkFdWZLuACx9MQ@mail.gmail.com> (raw)
In-Reply-To: <db33bc47-1b75-acee-905a-8883a7520193@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 2048 bytes --]

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 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/d4cd40347a916dd36c8239afecf64a7d/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’s 0.2ms at the top and 5.6ms at the bottom. Smartparens can 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’s 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’t really offer this as an option
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’t the place to debate the merits of easy for most
people to use bug reporting.

<img
> src=3D=22h=ttp://
> pixels.canarymail.io/tracking/07C7B5E0-9441-40AD-9CC3-D2A176741827.=png=22
> id=3D=22141121424AC1=466A74CBB8A45B347C37B=22 style=3D=22width: 1p=x;
> height: 1px;=22>
>

Yeah, canary isn’t even the client I’m using anymore, it’s 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.
-- 
Aaron

[-- Attachment #2: Type: text/html, Size: 3179 bytes --]

  reply	other threads:[~2016-07-25  7:12 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-21 14:29 bug#24048: 25.0.95; syntax-ppss can be slow Aaron Jensen
2016-07-25  1:16 ` Dmitry Gutov
2016-07-25  7:12   ` Aaron Jensen [this message]
2016-07-25 12:42     ` Dmitry Gutov
2016-07-25 15:08       ` Aaron Jensen
2018-03-30 13:09         ` Aaron Jensen
2021-12-01 19:47           ` Lars Ingebrigtsen
2021-12-03  2:38             ` Aaron Jensen
2021-12-03 16:26               ` Lars Ingebrigtsen
2021-12-03 17:01 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-04  1:31   ` Aaron Jensen
2021-12-04  2:41     ` Lars Ingebrigtsen
2021-12-04 14:40     ` Dmitry Gutov
2021-12-04 16:27       ` Aaron Jensen
2021-12-05  0:13         ` Dmitry Gutov
2021-12-05  5:06           ` Aaron Jensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAHyO48ywOJY8F7=bJbEPA9mcN1WnZx56fQzbzkFdWZLuACx9MQ@mail.gmail.com' \
    --to=aaronjensen@gmail.com \
    --cc=24048@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).