[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add a function for building sort predicates
From: |
Michael Heerdegen |
Subject: |
Re: Add a function for building sort predicates |
Date: |
Thu, 01 Feb 2024 20:22:01 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
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.
- Re: Add a function for building sort predicates, (continued)
- Re: Add a function for building sort predicates, Daniel Mendler, 2024/02/01
- Re: Add a function for building sort predicates, Eli Zaretskii, 2024/02/01
- Re: Add a function for building sort predicates, Michael Heerdegen, 2024/02/01
- Re: Add a function for building sort predicates, Eli Zaretskii, 2024/02/01
- Re: Add a function for building sort predicates, Michael Heerdegen, 2024/02/02
- Re: Add a function for building sort predicates, Emanuel Berg, 2024/02/03
- Re: Add a function for building sort predicates, Eli Zaretskii, 2024/02/03
- Re: Add a function for building sort predicates, Michael Heerdegen, 2024/02/03
Re: Add a function for building sort predicates, Michael Heerdegen, 2024/02/01
RE: [External] : Add a function for building sort predicates, Drew Adams, 2024/02/01