# Managing \`cast\` performance penalty

**URL:** https://racket.discourse.group/t/managing-cast-performance-penalty/905
**Category:** Questions & Answers
**Tags:** question, typed-racket
**Created:** [April 21, 2022, 2:22pm UTC](https://racket.discourse.group/t/managing-cast-performance-penalty/905 "2022-04-21T14:22:24Z")
**Posts on this page:** 1
**Showing post:** 16

<div class="post-metadata">

### Author: ![NoahStoryM](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/noahstorym/32/17_2.png) [@NoahStoryM](https://racket.discourse.group/u/NoahStoryM)
#### Post date: [April 25, 2022, 12:10am UTC](https://racket.discourse.group/t/managing-cast-performance-penalty/905/16 "2022-04-25T00:10:14Z")

</div>

Yes, I'm also impressed that `match` is so complicated that it becomes very difficult to directly annotate the type of the matched variable. This is why I basically only use #:when style now (as we discussed in [Is it good style to use `#:when` instead of `?` in match expression?](https://racket.discourse.group/t/is-it-good-style-to-use-when-instead-of-in-match-expression/779)).

And in TR, `match` seems not to design a syntax for declaring types, types can only be declared through reader extension (although I rarely do this, but I think this is at least an example to illustrate the use of reader extension)

---

_[View the full topic](https://racket.discourse.group/t/managing-cast-performance-penalty/905)._
