unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: [Emacs-diffs] master fbda511: Fix cps--gensym
       [not found] ` <E1YsjhZ-0002a0-0n@vcs.savannah.gnu.org>
@ 2015-05-14 16:00   ` Stefan Monnier
  2015-05-14 23:48     ` Leo Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2015-05-14 16:00 UTC (permalink / raw)
  To: emacs-devel; +Cc: Leo Liu

>    ;; Change this function to use `cl-gensym' if you want the generated
>    ;; code to be easier to read and debug.
>    ;; (cl-gensym (apply #'format fmt args))
> -  `(make-symbol ,fmt))
> +  `(make-symbol (format ,fmt . ,args)))
 
Why?  As the comment above says, if you want the more readable names,
you should use the other line of code.  The default one is aimed at
being more efficient (both cpu-use-wise and memory-use-wise),


        Stefan



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

* Re: [Emacs-diffs] master fbda511: Fix cps--gensym
  2015-05-14 16:00   ` [Emacs-diffs] master fbda511: Fix cps--gensym Stefan Monnier
@ 2015-05-14 23:48     ` Leo Liu
  2015-05-15  2:05       ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Leo Liu @ 2015-05-14 23:48 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On 2015-05-15 00:00 +0800, Stefan Monnier wrote:
> Why?  As the comment above says, if you want the more readable names,
> you should use the other line of code.  The default one is aimed at
> being more efficient (both cpu-use-wise and memory-use-wise),

I changed it because the expansion of iter-lambda etc. was difficult to
read. I don't understand the efficiency issue so the change may be a
mistake. Could you elaborate on what the issue is? Thanks.

Leo



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

* Re: [Emacs-diffs] master fbda511: Fix cps--gensym
  2015-05-14 23:48     ` Leo Liu
@ 2015-05-15  2:05       ` Stefan Monnier
  2015-05-15  4:42         ` Leo Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2015-05-15  2:05 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

>> Why?  As the comment above says, if you want the more readable names,
>> you should use the other line of code.  The default one is aimed at
>> being more efficient (both cpu-use-wise and memory-use-wise),
> I changed it because the expansion of iter-lambda etc. was difficult to
> read.

Right, and as the comment say, when you want to read the expansion, you
should use the other code (the one that uses cl-gensym+format).

> I don't understand the efficiency issue so the change may be a
> mistake. Could you elaborate on what the issue is? Thanks.

format is already significantly more expensive than make-symbol, so
obviously, make-symbol + format will be even worse.


        Stefan



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

* Re: [Emacs-diffs] master fbda511: Fix cps--gensym
  2015-05-15  2:05       ` Stefan Monnier
@ 2015-05-15  4:42         ` Leo Liu
  2015-05-15 18:19           ` Stefan Monnier
  0 siblings, 1 reply; 6+ messages in thread
From: Leo Liu @ 2015-05-15  4:42 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On 2015-05-15 10:05 +0800, Stefan Monnier wrote:
> format is already significantly more expensive than make-symbol, so
> obviously, make-symbol + format will be even worse.

OK but this doesn't impact runtime, right? All the hard work will be
done in compile time.

Leo



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

* Re: [Emacs-diffs] master fbda511: Fix cps--gensym
  2015-05-15  4:42         ` Leo Liu
@ 2015-05-15 18:19           ` Stefan Monnier
  2015-05-16  1:07             ` Leo Liu
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Monnier @ 2015-05-15 18:19 UTC (permalink / raw)
  To: Leo Liu; +Cc: emacs-devel

>> format is already significantly more expensive than make-symbol, so
>> obviously, make-symbol + format will be even worse.
> OK but this doesn't impact runtime, right? All the hard work will be
> done in compile time.

No, it only impacts the macroexpansion time/space.  But the point is
that if you don't care about that, then you should use the
cl-gensym version.  The make-symbol version is the "fast path", so making
it fat&slow makes no sense.


        Stefan



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

* Re: [Emacs-diffs] master fbda511: Fix cps--gensym
  2015-05-15 18:19           ` Stefan Monnier
@ 2015-05-16  1:07             ` Leo Liu
  0 siblings, 0 replies; 6+ messages in thread
From: Leo Liu @ 2015-05-16  1:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

On 2015-05-16 02:19 +0800, Stefan Monnier wrote:
> No, it only impacts the macroexpansion time/space.  But the point is
> that if you don't care about that, then you should use the
> cl-gensym version.  The make-symbol version is the "fast path", so making
> it fat&slow makes no sense.

OK, Stefan, I've just reverted the change.

Leo



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

end of thread, other threads:[~2015-05-16  1:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20150514032048.9882.50538@vcs.savannah.gnu.org>
     [not found] ` <E1YsjhZ-0002a0-0n@vcs.savannah.gnu.org>
2015-05-14 16:00   ` [Emacs-diffs] master fbda511: Fix cps--gensym Stefan Monnier
2015-05-14 23:48     ` Leo Liu
2015-05-15  2:05       ` Stefan Monnier
2015-05-15  4:42         ` Leo Liu
2015-05-15 18:19           ` Stefan Monnier
2015-05-16  1:07             ` Leo Liu

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