[racket] typed racket slow?

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Wed May 8 10:35:37 EDT 2013

On Wed, May 8, 2013 at 6:19 AM, Carl Eastlund <cce at ccs.neu.edu> wrote:
>
> I see just under 5 seconds for test.rkt and just over 5 seconds for
> utest.rkt.  So there's a fraction of a second extra startup time for Typed
> Racket, but it takes less time for each subsequent computation, so the
> difference depends on how much "real" work you do after startup.  I don't
> know what causes that startup cost, but hopefully this kind of benchmark
> will be useful to the Typed Racket maintainers in closing the gap for future
> versions.  So, thanks for the example, Manfred!

This is all true, and you can see it in simpler examples.  The empty modules:

#lang typed/racket/base

and

#lang racket/base

have the following timings:

[samth at hermes:~/tmp plt] time racket test.rkt

real    0m0.592s
user    0m0.516s
sys    0m0.064s
[samth at hermes:~/tmp plt] time racket test2.rkt

real    0m0.065s
user    0m0.040s
sys    0m0.024s

So you can see about 500 ms of extra overhead. Most of this time is in
loading and executing the runtime dependencies of Typed Racket, which
aren't used here, but which the implementation architecture of Typed
Racket makes it basically impossible to reduce.  We've worked hard to
reduce this cost, but it's hard to go much further.

Sam

Posted on the users mailing list.