Having just done a pretty trivial microbenchmark of writing a lot of
numbers to file, I discovered that Racket is sadly not as fast as one
would hope here.  You can see the program I ran at:
https://gist.github.com/2874695, along with a python program I
compared it to [1].  The Racket program is about twice as slow as the
python program:

[samth@loki:~/tmp/dd plt] time r ints.rkt 10000000
real    0m12.792s
user    0m12.497s
sys     0m0.284s
[samth@loki:~/tmp/dd plt] time python ints.py 10000000
real    0m7.570s
user    0m7.188s
sys     0m0.108s

If we change the program to use `(write-string (number->string ...))`
instead of `(write ...)`, things get much better:

[samth@loki:~/tmp/dd plt] time r ints.rkt 10000000
real    0m8.204s
user    0m8.013s
sys     0m0.184s

I was surprised to see this big a change.  Is there (a) some general
improvement lurking here, or (b) some way to get the benefit of the
explicit conversion without writing it out?  Alternatively, should the
Typed Racket optimizer start performing this conversion for numbers
when printed/written?

[1] See 
http://blog.cdleary.com/2012/06/simple-selfish-and-unscientific-shootout/
for background
-- 
sam th
sa...@ccs.neu.edu
_________________________
  Racket Developers list:
  http://lists.racket-lang.org/dev

Reply via email to