I think you want to use `in-range`. On my machine, adding `in-range`
makes each loop run 20 times faster --- which means that the original
loops are just testing the performance of the generic sequence case of
`for`.

(Probably we should make `for` recognize and specialize literal
integers, and I think someone has suggested that before...).

At Fri, 31 Jul 2015 14:05:57 +0100, Laurent wrote:
> Hi,
> 
> A little stress test seems to suggest that the JIT is currently not able to
> optimize closures with static arguments:
> https://gist.github.com/Metaxal/4beb286cacc0966b433a
> 
> That's a simplified version of some cases of mine where several complex
> procedures that look very much alike, so I'd really like to avoid
> copy/paste/maintain, but these procedures are also inside intensive loops,
> so I'd really like to not sacrifice speed.
> 
> Is there a better way to write this code with copy/paste to allow for
> optimizations?
> 
> Thanks,
> Laurent
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to