<div dir="ltr"><div><div><div><div><div><div><div>I recently posted a question about interactions between a typed/racket module and an untyped module.  Asumu pointed me to a known problem in the contract system that has not yet been addressed.  <a href="http://docs.racket-lang.org/guide/contracts-gotchas.html#%28part._.Mixing_set__and_contract-out%29">http://docs.racket-lang.org/guide/contracts-gotchas.html#%28part._.Mixing_set__and_contract-out%29</a><br><br></div>By adding getter functions for my provided variables, I was able to get the code working.  At this point, about one-fifth of my code is now typed.  Unfortunately, this version is 2.5 times slower than the original.<br><br></div>So my questions:<br></div>1. Is this unsurprising?  Do I need to port <i>all</i> of my code before I can expect to see a speed-up?  (And until then can expect a slow-down?)<br></div>2. A number of my data structures use byte numbers.  Am I incurring a penalty using Byte and should instead use Index or some other numeric type? (My application hits memory limits so delaying that is important unless it is the case that using the smaller numbers costs many times more than the space required for larger number types.)<br>3. I'm doing a fair bit of mutation of byte strings and defined structures.  Could this explain the slow down in TR?<br></div>4. Could the getter functions added in response to Asumu's pointer be causing significant performance penalties?<br></div>5. What else might I consider?<br><br></div><div>Thanks for any help. --Wayne<br></div><div><br></div><br></div>