unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 5f8922b9e2: ; * lisp/emacs-lisp/cconv.el (cconv--var-classification): Optimise.
       [not found] ` <20220709095421.898F1C0F1E3@vcs2.savannah.gnu.org>
@ 2022-07-09 15:38   ` Stefan Monnier
  2022-07-09 16:13     ` Mattias Engdegård
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Monnier @ 2022-07-09 15:38 UTC (permalink / raw)
  To: emacs-devel; +Cc: Mattias Engdegård

Mattias Engdegård [2022-07-09 05:54:21] wrote:
>     ; * lisp/emacs-lisp/cconv.el (cconv--var-classification): Optimise.
> ---
>  lisp/emacs-lisp/cconv.el | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/lisp/emacs-lisp/cconv.el b/lisp/emacs-lisp/cconv.el
> index eca1123899..7f95fa94fa 100644
> --- a/lisp/emacs-lisp/cconv.el
> +++ b/lisp/emacs-lisp/cconv.el
> @@ -267,8 +267,7 @@ Returns a form where all lambdas don't have any free variables."
>  
>  (define-inline cconv--var-classification (binder form)
>    (inline-quote
> -   (alist-get (cons ,binder ,form) cconv-var-classification
> -              nil nil #'equal)))
> +   (cdr (assoc (cons ,binder ,form) cconv-var-classification))))

I think a better optimization for that is to write a compiler-macro, no?


        Stefan




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: master 5f8922b9e2: ; * lisp/emacs-lisp/cconv.el (cconv--var-classification): Optimise.
  2022-07-09 15:38   ` master 5f8922b9e2: ; * lisp/emacs-lisp/cconv.el (cconv--var-classification): Optimise Stefan Monnier
@ 2022-07-09 16:13     ` Mattias Engdegård
  0 siblings, 0 replies; 2+ messages in thread
From: Mattias Engdegård @ 2022-07-09 16:13 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

9 juli 2022 kl. 17.38 skrev Stefan Monnier <monnier@iro.umontreal.ca>:

> I think a better optimization for that is to write a compiler-macro, no?

Thought about it but a quick scan found few other occurrences so it didn't seem to be time well spent. (Go ahead if you like, but now there is even less reason to -- sorry about that.)

In this case the author presumably cared about performance enough to use `define-inline` so the old code felt out of place.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-09 16:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <165736046128.27360.2696493706334277108@vcs2.savannah.gnu.org>
     [not found] ` <20220709095421.898F1C0F1E3@vcs2.savannah.gnu.org>
2022-07-09 15:38   ` master 5f8922b9e2: ; * lisp/emacs-lisp/cconv.el (cconv--var-classification): Optimise Stefan Monnier
2022-07-09 16:13     ` Mattias Engdegård

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).