help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: return first element in list with certain property


From: Michael Heerdegen
Subject: Re: return first element in list with certain property
Date: Tue, 21 Nov 2017 19:37:01 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Philipp Stephani <p.stephani2@gmail.com> writes:

> Please consider Knuth's statement about premature optimization. Until
> your users have actually complained about the speed of your product
> and you have benchmarked it and isolated cl-find-if as the culprit,
> there's no need to micro-optimize. Presumably cl-find-if has performed
> two iterations for years or decades without anybody being bothered
> enough to improve it.

Not only that.  Seems the second iteration is at least ~50 times faster
than the first one (using `elt' that is much faster than a loop), so it
doesn't matter anyway.  If your program is slow, the second iteration
will never be the culprit.


Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]