From: Arthur Miller <arthur.miller@live.com>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: "Mattias Engdegård" <mattiase@acm.org>,
50777@debbugs.gnu.org,
"Stefan Monnier" <monnier@iro.umontreal.ca>,
"Daniel Martín" <mardani29@yahoo.es>
Subject: bug#50777: Dropping EIEIO from xref (for performance)
Date: Fri, 24 Sep 2021 17:12:46 +0200 [thread overview]
Message-ID: <AM9PR09MB4977F119D39FBCDAF4DB188C96A49@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <ae803302-35d5-34ce-85e6-5921be60c914@yandex.ru> (Dmitry Gutov's message of "Fri, 24 Sep 2021 16:37:25 +0300")
Dmitry Gutov <dgutov@yandex.ru> writes:
> Resending with the intended recipients (except for the maintainers who are
> automatically subscribed anyway, to spare the inboxes).
>
> With the recent discussion about our Lisp overhead when the search returns many
> matches, I went a couple more rounds to try to identify the hotspots.
>
> My main benchmark for that is
>
> (benchmark 1 '(project-find-regexp "list"))
>
> in the Emacs repo. The 3 recent commits have reduced that time from 8s to 6.5s
> on my machine (under best conditions: warm disk cache and fresh Emacs
> session). The machine is pretty fast, so I figure we can multiply that timing by
> 2x, to imagine the average user experience.
>
> Having exhausted the obvious steps, I have looked at the difference between
> defclass and cl-defstruct in this respect. Earlier quick tests indicated there
> would be little to no difference, but now that I've wrote the full patch, it's
> significant.
>
> The attached patch drops the timing of the above benchmark further down to 4.1s
> here.
>
> Both allocation ('make-instance' vs auto-generated 'xref-make-*' struct
> constructors) and accessing the fields show increased performance, with the
> former showing the most improvement: I guess EIEIO's type checking added some
> extra overhead.
>
> That creates some incompatibility (third-party packages can't inherit from
> 'xref-location' anymore, or use 'make-instance', 'oref' or 'with-slots' with our
> values), but OTOH a quick survey of existing packages that integrate with Xref
> shows they wisely don't do that already. Not the largest, popular ones I have
> reviewed, at least.
>
> The ones that do can be updated to rely on the recommended public interface: the
> xref-make-* constructors and the generic functions to access the data. This will
> keep the code compatible with both new and previous versions of Xref.
>
> I'd like to push it soon, so users of Emacs 28 can enjoy the speedup.
>
> What do people think?
Yes please.
next prev parent reply other threads:[~2021-09-24 15:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-24 13:28 bug#50777: Dropping EIEIO from xref (for performance) Dmitry Gutov
2021-09-24 13:35 ` Dmitry Gutov
2021-09-24 13:37 ` Dmitry Gutov
2021-09-24 14:49 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-24 15:32 ` Dmitry Gutov
2021-09-26 1:15 ` Dmitry Gutov
2021-09-26 8:51 ` Mattias Engdegård
2021-09-26 18:34 ` Dmitry Gutov
2021-09-24 15:12 ` Arthur Miller [this message]
2021-09-25 1:42 ` Lars Ingebrigtsen
2021-09-25 1:52 ` Dmitry Gutov
2021-09-25 14:07 ` Daniel Martín via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-26 2:16 ` Dmitry Gutov
2021-09-30 21:10 ` Dmitry Gutov
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=AM9PR09MB4977F119D39FBCDAF4DB188C96A49@AM9PR09MB4977.eurprd09.prod.outlook.com \
--to=arthur.miller@live.com \
--cc=50777@debbugs.gnu.org \
--cc=dgutov@yandex.ru \
--cc=mardani29@yahoo.es \
--cc=mattiase@acm.org \
--cc=monnier@iro.umontreal.ca \
/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).