[prev in list] [next in list] [prev in thread] [next in thread] 

List:       racket-users
Subject:    [plt-scheme] Are superfluous expressions optimized away?
From:       robby () cs ! uchicago ! edu (Robby Findler)
Date:       2007-02-21 13:37:03
Message-ID: 932b2f1f0702210537m3816d777q7cb95bd34482fe51 () mail ! gmail ! com
[Download RAW message or body]

Sorry -- my reply was confusing. My reply was mean to say that such
debugging macros would not incur performance penalty. Such things like
(void) in a begin (implicit or otherwise) have long been removed by
mzscheme.

Robby

On 2/21/07, Eli Barzilay <eli at barzilay.org> wrote:
> Actually it looks like they do -- I entered these expressions in
> mzscheme:
>
>   (compile '(lambda () (void) (printf "foo\n")))
>   (compile '(lambda () (printf "foo\n")))
>   (require mzscheme)
>   (compile '(lambda () (void) (printf "foo\n")))
>   (compile '(lambda () (printf "foo\n")))
>
> and the last two (after hard-wiring mzscheme primitives) look shorter
> *and* they're identical.
>
>
> On Feb 20, Robby Findler wrote:
> > They don't. But don't take my word for it. Do some timing tests.
> >
> > Robby
> >
> > On 2/20/07, Derick Eddington <derick.eddington at gmail.com> wrote:
> > > Are superfluous expressions, like say '() or (void) when not in tail- or
> > > binding- or pass-value-position or any other value-is-used position,
> > > optimized away (maybe only when compiled to byte-code)?  I'm wondering
> > > if conditional compilation macros like (debug expr ...) which expand to
> > > '() or (void) would incur zero performance penalty?  If not, the
> > > performance cost is probably very negligible?
>
> --
>           ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
>                   http://www.barzilay.org/                 Maze is Life!
>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic