[racket] Typed-Racket slow-down by more than factor of two

From: Wayne Iba (iba at westmont.edu)
Date: Wed Oct 29 17:23:25 EDT 2014

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.
http://docs.racket-lang.org/guide/contracts-gotchas.html#%28part._.Mixing_set__and_contract-out%29

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.

So my questions:
1. Is this unsurprising?  Do I need to port *all* of my code before I can
expect to see a speed-up?  (And until then can expect a slow-down?)
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.)
3. I'm doing a fair bit of mutation of byte strings and defined
structures.  Could this explain the slow down in TR?
4. Could the getter functions added in response to Asumu's pointer be
causing significant performance penalties?
5. What else might I consider?

Thanks for any help. --Wayne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20141029/170ce981/attachment.html>

Posted on the users mailing list.