emacs-devel
[Top][All Lists]
Advanced

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

Re: make-variable-buffer-local change


From: Dan Nicolaescu
Subject: Re: make-variable-buffer-local change
Date: Fri, 25 Sep 2009 14:25:12 -0700 (PDT)

Stefan Monnier <address@hidden> writes:

  > >> Isn't it slightly more efficient to access global bindings than buffer
  > >> local bindings,
  > > No.
  > 
  > Sorry, I think I misread.  The answer is "yes".
  > But the efficiency is the same for a variable after
  > make-variable-buffer-local as after make-local-variable.

So if you have:

(defvar foo nil)
(make-variable-buffer-local 'foo)

The do: (if (buffer-local-value 'foo) BLAH)

vs

(defvar foo nil)

and then in very few buffers, majority do not change the value of foo:

(set (make-local-variable 'foo) 'bar)

and do the same computation:

(if (buffer-local-value 'foo) BLAH)


is one of these 2 versions more efficient than the other?




reply via email to

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