From: Aaron Jensen <aaronjensen@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: npostavs@users.sourceforge.net, 23928@debbugs.gnu.org
Subject: bug#23928: 25.0.95; Performance regression observable with smartparens
Date: Sun, 10 Jul 2016 15:58:58 +0000 [thread overview]
Message-ID: <CAHyO48yLCqx4BSnXZnhQF2PRrp0CKxcS_SqiN2DLfNN+kg=vCw@mail.gmail.com> (raw)
In-Reply-To: <83h9bxftx4.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 2477 bytes --]
On Sun, Jul 10, 2016 at 7:30 AM Eli Zaretskii <eliz@gnu.org> wrote:
> Thanks.
>
> That rings a bell. The hottest function on these profiles is
> sp--looking-back, which calls in a loop sp--looking-at, which does
> this:
>
> (defun sp--looking-at (regexp)
> "Like `looking-at', but always case sensitive."
> (let ((case-fold-search nil))
> (looking-at regexp)))
>
> As you will see from bug#18522, binding case-fold-search can be very
> expensive, especially if you have a lot of buffers. See
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=18522#201 for a summary
> of the findings there. It clearly shows in your profile:
>
> sp--looking-at 171 12%
> let 12 0%
>
> As to why you see a slowdown in Emacs 25, I don't know. Maybe you
> have more buffers crop up there as the session goes on?
>
Interesting, yes this is possible. I switched to Emacs 25 before I started
emacs itself heavily and using window configurations heavily, so it is very
likely that I just end up with a large number of buffers and that’s when
the slowdown happens.
What is the alternative to binding case-fold-search? Could smartparens just
bind it once in a surrounding function? Or is there another way to ensure
that `looking-at` is case sensitive?
> > One curious thing is that the emacs 24 profile shows all of the builtins
> (let/if/save-excusion) and the emacs 25 profile does not. Is there
> something I’m doing wrong that is causing that?
>
> Could it be that in Emacs 24 you loaded the library as a .el file, and
> in Emacs 25 as a .elc file?
>
I suppose this is possible, I had just started emacs 24 and let it install
all from elpa/melpa (I’m using spacemacs, so it handled all this for me).
Typically it compiles everything, but maybe it hadn’t yet in the session I
was running. I have confirmed that if I eval-buffer smartparens.el, I get
the more detailed profile. That’s useful, thanks.
> > I’ll work on this. It seems possible that it will be very hard to track
> down given the nature—the performance isn’t *always* bad, it just becomes
> bad at some point in the session.
>
> When it becomes bad, count the number of buffers in each session.
> Bug#18522 provides some tools for that.
>
I couldn’t figure out how to count all_buffers, but I saw (length
(buffer-list)), is that sufficient?
--
Aaron
[-- Attachment #2: Type: text/html, Size: 3335 bytes --]
next prev parent reply other threads:[~2016-07-10 15:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-09 14:56 bug#23928: 25.0.95; Performance regression observable with smartparens Aaron Jensen
2016-07-09 15:53 ` Noam Postavsky
2016-07-09 17:01 ` Eli Zaretskii
2016-07-10 2:55 ` Aaron Jensen
2016-07-10 14:29 ` Eli Zaretskii
2016-07-10 15:58 ` Aaron Jensen [this message]
2016-07-10 16:14 ` Eli Zaretskii
2016-07-10 16:53 ` Aaron Jensen
2016-07-10 17:14 ` Eli Zaretskii
2016-07-10 18:42 ` Dmitry Gutov
2016-07-10 19:01 ` Eli Zaretskii
2016-07-10 19:17 ` Dmitry Gutov
2016-07-10 19:20 ` Eli Zaretskii
2016-07-10 19:56 ` Dmitry Gutov
2016-07-11 2:28 ` Eli Zaretskii
2016-07-11 2:48 ` Aaron Jensen
2016-07-11 2:49 ` Aaron Jensen
2016-07-11 14:38 ` Eli Zaretskii
2016-07-20 4:58 ` Aaron Jensen
2016-07-20 14:56 ` Eli Zaretskii
2016-07-10 18:49 ` Aaron Jensen
2016-07-09 16:50 ` Eli Zaretskii
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='CAHyO48yLCqx4BSnXZnhQF2PRrp0CKxcS_SqiN2DLfNN+kg=vCw@mail.gmail.com' \
--to=aaronjensen@gmail.com \
--cc=23928@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=npostavs@users.sourceforge.net \
/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).