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: Philipp Stephani
Subject: Re: return first element in list with certain property
Date: Tue, 21 Nov 2017 18:01:40 +0000

Emanuel Berg <moasen@zoho.com> schrieb am Di., 21. Nov. 2017 um 02:55 Uhr:

> Eric Abrahamsen wrote:
>
> > In that case there will be less difference
> > between the two: as Drew noted, `cl-find-if'
> > will traverse the list twice, which only
> > becomes a big problem if the desired element
> > is at the end of the list.
>
> It doesn't have to be a problem, it is bizarre
> as it is. Thanks for mentioning it, I'll change
> to `seq-find'.
>
> See, my intuition was right, seq-find *is*
> better even tho you guys are in denial about
> it :)
>

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.


reply via email to

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