[racket] Reversing strings (Jay's article)

From: Vlad Kozin (vladilen.kozin at gmail.com)
Date: Wed Oct 2 13:28:59 EDT 2013

Mostly a question to Jay McCarthy but I suppose could be interesting to others. Was going over his Reversing strings article. Somehow I get weird performance. Slowest solution turns out fastest, medium, fast and really fast are only marginally different.

Could anyone have a look https://github.com/vkz/warm-up
reverse-string.rkt has the solutions
test-reverse-string.rkt does the performance check
Testing it on 40'000 randomly generated strings 1000 chars each.

While we're at it, why do we garbage-collect thrice here?
let-values ([(as cpu real gc) (time-apply (λ () exp) empty)])
    (collect-garbage) (collect-garbage) (collect-garbage)

Vlad Kozin <vladilen.kozin at gmail.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20131002/8290bee4/attachment-0001.html>

Posted on the users mailing list.