What Matthew and everyone else said is critical. Read those before reading on. Also consider using optimizations in Racket or converting to TR and asking for fixed-point numbers.
;; --- However, we do understand the need for running programs in both worlds (Racke and CL). An alternative is to write a program so that it basically ports itself (with a few tweaks). For years, Dorai Sitaram maintained a macro/constraint set for just this purpose. The idea is written down in a short Scheme Workshop paper: http://repository.readscheme.org/ftp/papers/sw2003/Scmxlate.pdf Producing a #lang cl/port for this purpose would be a 'good thing'. Others may benefit too. You could contribute it to Planet. -- Matthias On Nov 4, 2012, at 8:20 AM, Matthew Flatt wrote: > At Fri, 2 Nov 2012 16:25:09 +0000 (UTC), daniel rupistraliz avez wrote: >> One motivation is speed, for example a recent example in the racket blog >> about >> the 2n+1 problem gives 1200 milliseconds in Racket and 500 in sbcl (without >> declaring fixnum or any other optimization). > > Although it's not really your question, I'm generally interested in > understanding performance differences. Can you tell me more about what > you're measuring, and maybe provide the SBCL version of the code that > you're using? > > > If I take Danny's code form the blog and just try > > time racket three-n-plus-one.rkt < sample-data.txt > > on the command line, it takes 720 millisecond on my machine, but > essentially all of that time is loading and compiling the code. > Wrapping `time' around the body of the `main' submodule shows that the > actual computation takes only 2 milliseconds. > > If I try > > raco make three-n-plus-one.rkt > time racket three-n-plus-one.rkt < sample-data.txt > > then the overall time drops down to 264 milliseconds. Some other > changes can reduce the start-up time further, but I don't know if this > is at all related the way you're measuring performance. > > So, I wonder whether you're using different inputs and how you're > measuring the run time. > > Thanks! > > ____________________ > Racket Users list: > http://lists.racket-lang.org/users
smime.p7s
Description: S/MIME cryptographic signature
____________________ Racket Users list: http://lists.racket-lang.org/users