all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Aaron Jensen <aaronjensen@gmail.com>, 24048@debbugs.gnu.org
Subject: bug#24048: 25.0.95; syntax-ppss can be slow
Date: Mon, 25 Jul 2016 04:16:45 +0300	[thread overview]
Message-ID: <db33bc47-1b75-acee-905a-8883a7520193@yandex.ru> (raw)
In-Reply-To: <b343cf26-e76b-4758-84ac-c20c1dd185b0@aaronmbp.local>

Hi Aaron,

On 07/21/2016 05:29 PM, Aaron Jensen wrote:
>
> In certain situations, the caching of syntax-ppss can seem to be
> insufficient for good performance when syntax-ppss is invoked in a tight
> loop. smartparens is a popular package that currently invokes
> syntax-ppss in a tight loop (about 30-100 times depending on how many
> match pairs are configured). syntax-ppss has caching built in, but it is
> willing to use a cache from a further back position and do a
> `parse-partial-sexp` from the old position to the current. Afterwards,
> it does not set the cache with the current position. As such, in the
> pathological case, it can parse ~2000 characters 30-100 times in a tight
> loop. This is slow enough to show up in profiling and affect typing
> latency.
>
> To repro, install:
>
> smartparens (you can use
> https://github.com/aaronjensen/smartparens/tree/limit-binding-of-case-fold-search
> to alleviate a different performance issue which could distract in the
> profiling)
> elixir-mode

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).

Here, I'm seeing some similar behavior with elisp-mode.el. I can open 
this file, evaluate

(benchmark 1000 '(syntax-ppss))

at line 10, then move to line 70 and do it there, and see the latter 
result to be much faster. They're still below 100ms usually (even with 
1000 repetitions), so that's hardly a good example of a performance 
problem, by itself.

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:

<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>





  reply	other threads:[~2016-07-25  1:16 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 [this message]
2016-07-25  7:12   ` Aaron Jensen
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

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

  git send-email \
    --in-reply-to=db33bc47-1b75-acee-905a-8883a7520193@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=24048@debbugs.gnu.org \
    --cc=aaronjensen@gmail.com \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.