[racket] Vast performance differences with minute syntactic differences
David Van Horn caught the bug. The fast module has an incorrect bind function that when fixed makes performance terrible. Nevermind this thread.
-Ian
----- Original Message -----
From: "J. Ian Johnson" <ianj at ccs.neu.edu>
To: "Sam Tobin-Hochstadt" <samth at ccs.neu.edu>
Cc: "J. Ian Johnson" <ianj at ccs.neu.edu>, "users" <users at racket-lang.org>
Sent: Thursday, October 4, 2012 9:47:52 PM GMT -05:00 US/Canada Eastern
Subject: Re: [racket] Vast performance differences with minute syntactic differences
I wrote two set-adds? Ugh, I didn't mean to. That code wouldn't even work due to arity mismatch.
(set-add res (let ([v v]) v)) is more likely.
-Ian
----- Original Message -----
From: Sam Tobin-Hochstadt <samth at ccs.neu.edu>
To: J. Ian Johnson <ianj at ccs.neu.edu>
Cc: users <users at racket-lang.org>
Sent: Thu, 4 Oct 2012 19:46:36 -0400 (EDT)
Subject: Re: [racket] Vast performance differences with minute syntactic differences
On Thu, Oct 4, 2012 at 7:01 PM, J. Ian Johnson <ianj at ccs.neu.edu> wrote:
>
> By almost exactly I mean
> (let () (set-add res v))
>
> versus
>
> (let ([res res])
> (set-add (let ([v v])
> (set-add res (let () v)))))
These seem importantly different, in that:
(set-add v (set-add res v))
and
(set-add res v)
are totally different values, and the former only works if both `v`
and `res` are sets.
If you want to determine the behavior of the compiler, which is what
matters for differences like extra `let` bindings, 'raco decompile' is
the best tool.
--
sam th
samth at ccs.neu.edu