unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Aaron Jensen <aaronjensen@gmail.com>
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 17:29:27 +0300	[thread overview]
Message-ID: <83h9bxftx4.fsf@gnu.org> (raw)
In-Reply-To: <CAHyO48xqMW=y3VJJLKNui2BAM6igKR3nuMWZcaep_rgq4uu5Kw@mail.gmail.com> (message from Aaron Jensen on Sun, 10 Jul 2016 02:55:31 +0000)

> From: Aaron Jensen <aaronjensen@gmail.com>
> Date: Sun, 10 Jul 2016 02:55:31 +0000
> Cc: 23928@debbugs.gnu.org
> 
> I’ve added profiles of both here:  https://gist.github.com/aaronjensen/a1c2b56eac192b0d9cac76b493822070
> 
> In this profile, they’re showing pretty much the exact same performance, so that doesn’t tell us much. I believe the performance degradation is something that happens over time, and these are fresh runs of emacs. I’ll have to try and get from 25 next time it slows down on me.

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?

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

>     And please don't use elp.el to produce profiles, use profiler.el,
>     because the latter can profile primitives as well.
> 
> I don’t even know how to use elp.el, was there some indication that I was?

Sorry, my bad.  It looked like elp.el output to me.





  reply	other threads:[~2016-07-10 14:29 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 [this message]
2016-07-10 15:58         ` Aaron Jensen
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=83h9bxftx4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=23928@debbugs.gnu.org \
    --cc=aaronjensen@gmail.com \
    --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).