[racket-dev] [plt] Push #25216: master branch updated

From: Neil Toronto (neil.toronto at gmail.com)
Date: Thu Aug 16 17:12:36 EDT 2012

> 0452bd7 Matthew Flatt <mflatt at racket-lang.org> 2012-08-16 12:46
> :
> | bytecode optimizer improvement
> |
> | Treat unsafe functional operations (which never raise an
> | exception) as omitable, which means that simple `let-values'
> | combinations can be split into `let' bindings, etc.
> :
>    M collects/ffi/unsafe/com.rkt         |  1 +
>    M collects/racket/private/for.rkt     |  2 +-
>    M collects/tests/racket/optimize.rktl | 12 ++++++++++++
>    M src/racket/src/optimize.c           |  8 ++++----

Suppose I'm writing in Typed Racket, and x1, x2, y1, y2, z1, z2 : Float. 
Does this optimization mean that this:

   (let-values ([(x y z)  (values (+ x1 x2) (+ y1 y2) (+ z1 z2))])
     ...)

is equivalent to the following?

   (let ([x  (+ x1 x2)]
         [y  (+ y1 y2)]
         [z  (+ z1 z2)])
     ...)

If so, I think that will speed up the ray tracer.

Neil ⊥


Posted on the dev mailing list.