[racket] Performance help
Hi, Jyotirmoy.
>> When I make that change, my run time decreases from ~16s to ~10s, and
>> produces the same output (which differs from output.txt in the same
>> way I mentioned above).
>
>> In relative terms this would probably get it close to the Python version?
>
> I merged a pull request from Matthias Felleisen who made the same change.
> This definitely increases the performance but the Racket program is still
> about 2x slower than Python.
Wait, 2X? With my pruned edit2, I'm seeing it quite close:
$ time python python2/norvig.py data/train.txt < data/test.txt > /dev/null
real 0m9.053s
user 0m9.008s
sys 0m0.043s
$ time racket racket/norvig.rkt data/train.txt < data/test.txt > /dev/null
real 0m10.285s
user 0m9.952s
sys 0m0.253s
This is on a two-year-old MacBook Pro Retina, OSX 10.7.5.
Python 2.7.1 and Racket v6.1.1.6.
Code: https://gist.github.com/greghendershott/a636357ba41b2c11e2d9
Admittedly I do wish it were even faster.
Best,
Greg