Re: [racket-users] Optimizing closures

2015-07-31 Thread Matthew Flatt
At Fri, 31 Jul 2015 18:56:15 +0100, Laurent wrote: > On Fri, Jul 31, 2015 at 5:40 PM, Matthew Flatt wrote: > > > At Fri, 31 Jul 2015 15:03:53 +0100, Laurent wrote: > > > I don't really understand why `in-range` makes such a difference. It > > looks > > > like the kind of sequence iterator is test

Re: [racket-users] Optimizing closures

2015-07-31 Thread Laurent
On Fri, Jul 31, 2015 at 5:40 PM, Matthew Flatt wrote: > At Fri, 31 Jul 2015 15:03:53 +0100, Laurent wrote: > > I don't really understand why `in-range` makes such a difference. It > looks > > like the kind of sequence iterator is tested at each step, whereas I was > > expecting it to be tested on

Re: [racket-users] Optimizing closures

2015-07-31 Thread Matthew Flatt
At Fri, 31 Jul 2015 15:03:53 +0100, Laurent wrote: > I don't really understand why `in-range` makes such a difference. It looks > like the kind of sequence iterator is tested at each step, whereas I was > expecting it to be tested only at the beginning of the loop, since this > sequence iterator ki

Re: [racket-users] Some help with syntax-parse: macro in macro

2015-07-31 Thread Deren Dohoda
Hi Stephen, At the moment, "collect" is syntax, itself defined through syntax-parse. So you suggest making "collect" a literal and changing the underlying macro name? It's part of a #lang experiment I'm writing which manages a series of actions from a controller. The file, when required, provides

Re: [racket-users] Full (fifth RacketCon) Program is up!

2015-07-31 Thread Vincent St-Amour
Yes, the plan is to both videotape and live stream the talks, like we did in previous years. You're welcome to hop on IRC (#racket on Freenode) during RacketCon and join the discussions! Vincent On Thu, 30 Jul 2015 03:16:58 -0500, Paulo Matos wrote: > > > On 29/07/2015 17:46, Vincent St-Amou

Re: [racket-users] Some help with syntax-parse: macro in macro

2015-07-31 Thread Stephen Chang
You might want to specify "collect" in #:datum-literals if it is not a defined name. Can you describe some usage examples? That may lead to better insight for the implementation. On Fri, Jul 31, 2015 at 11:49 AM, Deren Dohoda wrote: > Suppose I have a macro (experiment ...) which is intended, am

Re: [racket-users] Full (fifth RacketCon) Program is up!

2015-07-31 Thread Paulo Matos
On 29/07/2015 17:46, Vincent St-Amour wrote: The full program of (fifth RacketCon) is now available! [1] Don't forget to register! [2] For those not able to go to St Louis, will this be videotaped? Thanks. -- Paulo Matos -- You received this message because you are subscribed to the Google

[racket-users] Some help with syntax-parse: macro in macro

2015-07-31 Thread Deren Dohoda
Suppose I have a macro (experiment ...) which is intended, among other things, to be composed of uses of a macro (collect ...). For instance: (experiment (collect ...) (collect ...) ...) To my understanding, "collect" is not a literal. Can I turn the collect macro itself into a syntax clas

Re: [racket-users] Optimizing closures

2015-07-31 Thread Laurent
Yes indeed (and thanks all). My question still holds though: Can I expect the JIT to optimize the cases of my primary concern? (Or are these cases unlikely to be a bottleneck?) I'm unsure about how to set up correct stress tests as the JIT does a good job at optimizing a number of things and then

Re: [racket-users] Optimizing closures

2015-07-31 Thread Vincent St-Amour
FWIW, the optimization coach reports these kinds of issues, and recommends that solution. Vincent On Fri, 31 Jul 2015 09:03:53 -0500, Laurent wrote: > > Oh wow, this makes a huge difference indeed! (both in-range and v6.2) > Congrats for the efforts put in the new version! > > I don't really

Re: [racket-users] Optimizing closures

2015-07-31 Thread Laurent
Oh wow, this makes a huge difference indeed! (both in-range and v6.2) Congrats for the efforts put in the new version! I don't really understand why `in-range` makes such a difference. It looks like the kind of sequence iterator is tested at each step, whereas I was expecting it to be tested only

Re: [racket-users] Optimizing closures

2015-07-31 Thread Neil Van Dyke
Laurent wrote on 07/31/2015 09:05 AM: 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.

Re: [racket-users] Optimizing closures

2015-07-31 Thread Matthew Flatt
Also, which version of Racket are you using? With v6.1.1 and `in-range`, I get cpu time: 745 real time: 744 gc time: 0 cpu time: 205 real time: 205 gc time: 0 cpu time: 782 real time: 782 gc time: 0 cpu time: 205 real time: 206 gc time: 0 but with v6.2 and `in-range`, I get cpu time: 209 re

Re: [racket-users] Optimizing closures

2015-07-31 Thread Matthew Flatt
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 t

[racket-users] Re: Optimizing closures

2015-07-31 Thread Laurent
In particular, I often have a keyword #:update? to modify (set!) some variables, a keyword #:debug? to print some values on screen and perform some tests, and without these keywords the procedure is completely functional. So I suspect that the non-update non-debug version would be much faster if s

[racket-users] Optimizing closures

2015-07-31 Thread Laurent
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

Re: [racket-users] Re: Slack team for racket

2015-07-31 Thread J Arcane
Wow, is it two way then? On Fri, Jul 31, 2015 at 9:03 AM, Jack Firth wrote: > On Monday, July 27, 2015 at 1:15:31 AM UTC-7, mazert wrote: > > Le 27/07/2015 04:13, Jason Yeo a écrit : > > > Hi Everyone! > > > > > > For anyone out there who finds IRC too daunting and difficult to use, > there's a