all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Daniel Mendler <mail@daniel-mendler.de>
Cc: Michael Heerdegen via "Emacs development discussions."
	<emacs-devel@gnu.org>
Subject: Re: Add a function for building sort predicates
Date: Thu, 01 Feb 2024 20:22:01 +0100	[thread overview]
Message-ID: <87eddwuh0m.fsf@web.de> (raw)
In-Reply-To: <87bk909h7c.fsf@daniel-mendler.de> (Daniel Mendler's message of "Thu, 01 Feb 2024 19:23:35 +0100")

Daniel Mendler <mail@daniel-mendler.de> writes:

> Did you perform some measurements, comparing with the hand-written
> predicate in package.el?  The code does not look efficient with the
> function calls and the throws.

My version was around 6% slower. Using dynamic lookup of the key order.
I did not try with native compiling.

> In contrast, if the macro creates a sequence of conditions the native
> compiler can optimize the result. It all depends on the use case. If
> the rules are supposed to be customizable and the lists are short, the
> dynamic approach will likely work well enough. For long lists an
> efficient sort predicate makes a difference in my experience, e.g., in
> a dynamically updating completion UI with thousands of candidates,
> since the predicate is called very often.

A disadvantage is that custom option will have to introduce new :set
dependencies, I wanted to avoid that.

But in some cases the speed difference might be worth such an
optimization.  If you want to experiment, please be my guest.

Michael.



  reply	other threads:[~2024-02-01 19:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-01 17:06 Add a function for building sort predicates Michael Heerdegen
2024-02-01 17:19 ` Daniel Mendler via Emacs development discussions.
2024-02-01 17:26   ` Eli Zaretskii
2024-02-01 18:10     ` Michael Heerdegen via Emacs development discussions.
2024-02-01 19:09       ` Eli Zaretskii
2024-02-02 20:11         ` Michael Heerdegen
2024-02-03  2:55           ` Emanuel Berg
2024-02-03  7:08           ` Eli Zaretskii
2024-02-03 10:35             ` Michael Heerdegen
2024-02-01 18:04   ` Michael Heerdegen via Emacs development discussions.
2024-02-01 18:23     ` Daniel Mendler via Emacs development discussions.
2024-02-01 19:22       ` Michael Heerdegen [this message]
2024-02-01 20:19         ` Daniel Mendler via Emacs development discussions.
2024-02-01 22:48 ` [External] : " Drew Adams
2024-02-02 20:05   ` Michael Heerdegen
2024-02-02 22:30     ` Drew Adams

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=87eddwuh0m.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=emacs-devel@gnu.org \
    --cc=mail@daniel-mendler.de \
    /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.