emacs-devel
[Top][All Lists]
Advanced

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

Re: optimizing defconst


From: Kim F. Storm
Subject: Re: optimizing defconst
Date: Sat, 27 Oct 2007 23:17:17 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Dan Nicolaescu <address@hidden> writes:

> Given this:
>
> (defconst viper-xemacs-p (featurep 'xemacs))

Does using defsubst give better results?

>
> (defun foo()
>   (if viper-xemacs-p (error "Hmmmm")))
>
>
> Shouldn't `foo' be optimized to just do nothing? 
>
> It is not:
>
> byte code for foo:
>   args: nil
> 0 varref          viper-xemacs-p
> 1 goto-if-nil-else-pop 1
> 4 constant  error
> 5 constant  "Hmmmm"
> 6 call        1
> 7:1           return      
>
> Am I missing something?

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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