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:

Personally, I have applied unsafe operations with some success.



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).