Performance optimizations (by Typed Racket, or otherwise)

In the Racket Slack someone asked whether the optimizations by Typed Racket can be done from standard Racket. The answer was "yes", since Typed Racket is just a library. :slight_smile:

This made me curious. What kind of optimizations does Typed Racket do?

And what can I do manually, when not using Typed Racket?

As a start, there's a section on performance in the Racket Guide:

https://docs.racket-lang.org/guide/performance.html

Personally, I have applied unsafe operations with some success.

Stefan

2 Likes

After @soegaard helped me rediscover the Racket wiki, I can add

1 Like

The main optimizations TR does involve turning generic operations into unsafe ones when it can prove that it's safe to do so.
There's a few other small ones, like (the moral equivalent of) adding in-list and co to for loops which are missing them (which eventually results in unsafe operations as well).

3 Likes